The Supreme Court has held that even if the police have a flawed understanding of the laws and rules they are enforcing, their flawed interpretation governs the interaction on the street. So what the office believed matters, and that in turn guides his/her behavior. If you're in the right, you can usually be vindicated after a brief trip through the criminal justice system (arrest, jail, court). But it's guaranteed to ruin your day.
Safest bet would have been to ask "Am I free to go?" to find out.