Here's the bottom line:
If you engage, expect to be shot by responding officers.
This is *NOT* a ding on patrollers. Or any other group that runs to the call. They are simply going to be on 11, like you. If you see them before they see you, maybe you actively THROW your gun straight down and avoid catching a round. Or maybe you cover an area scanning for the next gunshot, and they roll up behind you and you hear them and turn to see an.... BLAM
It is what it is.
It doesn't matter what you wear. I've spent time as an armed guard at a college with college police and local police. Even in a uniform, known to the regulars, during training and just walking the halls... shit happens.
As for me, I've made my peace with it. I'm not standing there if I can help it, Lord willing. But there's no 'color of the day' or secret word / handshake / challenge / counter that works. What if the shooter IS a disgruntled guard or officer? A recent stabbing like last year, the guy had a guard uniform shirt on, and was shot by an off duty part-time police officer.
They are gonna roll in, hard. They are going to engage any threat they see, hard. Hopefully there is a challenge given, but if they aren't in a position of superior firepower, cover, or concealment, and especially if you present like you have extra bulk around the waist, you might just get popped.