An undercover officer has to identify himself before he starts issuing orders. In this situation, he needs to present his ID.
Many cops are thugs...not all...but many.
He needs to be reasonably identifiable. When you start with a street image, the bar goes up on reasonable. Saying “I’m a cop” s no longer sufficient. There is still the case of the two college girls. In their situation, their safety depended on instant reaction to insane behavior.