Let's talk about a hypothetical.
Let's say that someone had a repair job to do on the roof-mounted air-conditioning unit. Maybe it was leaking water, so it had to be fixed before dishes and bodies needed to be washed.
Climbing up and down a ladder several times, in the dark, carrying tools and parts is good exercise but not likely to engender good feelings towards all mankind - particularly the idiot that designed the unit so that it has to be disassembled to allow access to the one part likely to suffer corrosion damage.
Anyway, let's imagine job done, unit tested, tools away, all is good as our hero sits down to (a very belated) dinner. Wait! What's that noise? There is someone in the yard!
Let's imagine that said hero is a cautious type, that there is no way that he is investigating un-armed, and for him, being "not un-armed" does not mean he carries a heavy torch - nudge, nudge, wink, wink.
So, most people would have the yard lights on, all doors secured and locked except the one they intend to use, then the three of them (Smith, Wesson, and our hero) would creep towards the uninviting and uninvited (and here's the crux of our hypothetical) only to be confronted by a visibly armed man in some kind of uniform sneaking around the garden shed.
So, what do you do in such a situation?
Where our hero lives, shining a torch in a police officer's eyes is, according to case law, assault. "Assault on a public officer" carries a mandatory prison sentence.
Further, carrying a firearm into your back yard can lead to any number of charges from "failing to safely store a firearm" through "brandishing a firearm so as to cause terror" up to "whatever the prosecutor can think up"; any of which can cause your firearms license to be revoked and lead to forfeiture of all firearms AND YOUR HOUSE without compensation. As a side benefit, a conviction is NOT required.
Think quick, valiant hero.
Thought 1. Challenge the man and run the risk of possible criminal charges if he is police.
Thought 2. Sneak back inside, and pretend you didn't see him.
Thought 3. Shoot, shovel, shut up.
I can tell you that all of these thoughts rattle around in your head for what feels like hours.
Invoke command voice. Turn on torch, shine at intruder.
"STOP. FREEZE. KEEP YOUR HANDS WHERE I CAN SEE THEM. WHO ARE YOU, AND WHY ARE YOU HERE?"
Intruder, startled, turns and moves towards voice from the shadows.
"I SAID FREEZE. IF YOU COME CLOSER, I WILL KILL YOU."
Intruder stops, half raises hands placatingly.
"Who are you, and why are you here?"
Intruder announces that he is searching for a suspect from an earlier armed hold-up at the shopping centre down the road. He does not give his name, and does not identify himself as a police officer.
"Are you a police officer?"
"Of course," is the response. No name is provided, and no identification is presented.
"Did you see this man enter my property?"
Putative Officer replies that he "had reports" that the suspect was in the area.
"You did not see him, therefore you are not in active pursuit of a suspected criminal, therefore you need a warrant to enter my property. Where is it?"
Putative Officer blusters that he is a police officer, does not need to explain his actions to anyone, and can go where he likes.
"I remind you that you are trespassing on private property, it is dark, if you are police you have not identified yourself as required by law, you are visibly armed, and you are not being cooperative." Left unsaid is "... and I can kill you where you stand."
OK, now what? This guy is ... umm "annoyed" is somehow not strong enough. For somebody who suspects that he is being held at gun-point, he is remarkably aggressive. It's too late to fade into the dark, and leave him be. The entire incident is bound to be in his nightly report - suitably slanted of course to present our intrepid hero as a crazy man with a gun.
Thought 3 surfaces again.
"Show me some ID. Slowly."
"Put it on the ground and back up."
ID seems authentic. It does not carry photo of the bearer, but no police ID does in this jurisdiction.
"What is your name and police number?"
Response matches ID.
How the hell do you get out of this situation without:
B) being harrassed by the police force forever?