They do if they expect to exercise their authority qua authority.
You seem to have a great capacity to studiously ignore that salient point.
Why is that?
The officer had the right to approach him. He might have had some reasonable suspicion to question him, we don’t know. Regardless of that he certainly had the right to ask the guy to take his hand out of his pocket. Not 100% if he could order it, but once the guy refused and started acting so frantically, he certainly has reasonable suspicion and reason to believe the guy might be a danger.
The courts have given the police a great deal of lattitude when if comes to protecting their safety.