> According to a judge or a police officer, probably not
I'd naively hope that a judge wouldn't side with a police officer here, but I think the fact that resisting arrest is inherently criminal is a pretty big flaw in the US legal system.
I live in a jurisdiction [1] where resisting arrest is not criminalised in the same sense as the US, and the idea that a police officer could unlawfully arrest you and then immediately have lawful grounds if you resisted is very alien to me.
[1] : https://en.wikipedia.org/wiki/Resisting_arrest#England_and_W...