I would either do what you did; or if I saw that it was a cop, I would use the crosswalk option to get across on the green light side- then cross the street down the road further.
Maybe you just got a tired/irritable cop. Wrong place, wrong time.
Sounds like you handled it well.