Chris,
It basically was a snowball effect of sorts.
First and foremost, the reason they started blaring their sirens at you, I have not clue. It may have been a simple mistake, another red S13 dangerously driving earlier or in the area.
Where you did go wrong was when you refused to stay in the vehicle believe it or not. The officer could have been telling the truth when he said “it could have all been avoided if you stayed in the car”. They do have reasonable power to detain a person for “officer safety” until it has all be sorted out. By refusing their demands, It basically fueled their story/belief that something is not right, gives them “reasonable grounds”. Directly refusing their demands is also a offence of “obstructing justice” or something like that.
When they have believe they have beyond “reasonable grounds” that so and so committed this act they may act on a situation and possibly arrest. At this point they also have the authority the search the immediate scene for evidence, weapons or means of escape.
I know with your innocence and honest confusion it must have been hard to simply stay in the car, I don’t blame you man.
Hopefully this makes sense, and clears things up. Do fight this though.