Not sure quite why you think an innocent person should be made to produce ID simply because they were at the scene of an accident? Should the cop have asked for legal ID from all the witnesses on the street also? It doesn’t seem to me to be rude or unreasonable to point out to a police officer that you don’t see why, as a simple bystander, there is a need to produce ID. When did we become such wimps in this land of the free that we just do what is ordered by police officers (rhetorical question).
I think you meant to direct this to someone else. I agree with you.