Obeying the law doesn’t matter when interpreted by a moron with a gun and authority. FHP searched my car two weeks ago. Nothing found and my rights were violated. Nowhere to go... im ex-leo and still say f the police...
On some of the reality tv shows I see this militant attitude by police. Not excusing it. I have experienced it, too.
However, you weren't arrested. Sorry you had an unpleasant experience.
When stopped, #1 is that I will not be in violation of any law (except possibly a traffic violation), will have my CCW permit and be carrying legally, and be exceedingly polite to the officer, regardless of his/her attitude. I would never bluntly say "you cannot search my car", or "do you have a warrant", but would say "No, I prefer you don't search my car, etc."
No way in hades I remove my CCW regardless of what the officer says. The officer will have to do that. :)