The main point here is that the man was not in uniform and didn’t identify himself as a police officer. If a random dude walks up to you, accuses you of drinking, then demands to peek in your can, you’d probably tell him to go take a hike as well.
I think I got the gist of the situation at first reading, but thank you for highlighting the lack of identification again.
The whole point of an under cover officer is that you don’t know he is a cop.