I was actually thinking at a different level.
When I drive on the freeway, any time a police car gets behind me and turns on its lights, I have to stop. If I don't stop, I can ultimately be charged with evading arrest, or fleeing police, or some similar offense. I can be fined and even put in jail, even if a judge decides that the officer didn't actually have a valid reason to stop me.
If a police officer approaches me (when I'm not in a car) and tells me that I'm under arrest, I don't have the legal permission to leave. Even if I know I didn't break any laws. Even if I happen to know why the officer wants to arrest me and I know that it's not a valid reason for an arrest.
Why? Why does the law require me to obey without question, especially when honest mistakes that I might make are treated very differently from honest mistakes the trained officer might make? Fundamentally, because we have decided that the alternative is worse.
Do officers abuse their authority? Of course they do. But we've decided that toothless police departments aren't worth anything (and, in fact, lead to more vigilantism and crime). And we've decided that "self help" solutions (e.g., giving people the right to violently resist arrest if the officer is in the wrong, while punishing people who resist valid arrests) are worse.