damn. you know there could be a lot of truth to this.This is the way I see it going down:
Your pulled over by officer Dew-rite for a tail light out.
It is found you are a permit holder, and carrying.
He ask for your weapon to "run the numbers".
Just as you are removing your weapon and clearing it, to hand to Ofc Dew-right,, Barney is walking up on the passenger side and sees you racking a slide (to clear it) and he ventilates you.