There is no remedy available in real-time. The law says that you must always follow police instructions. So if the police pull you over for no reason, and handcuff you on the side of the road, you must submit to the handcuffing. If they demand to search your car, you must submit to that. It is only later that you can move to have evidence dismissed, or file a complaint.
I know this goes counter to how we [1] think the law works. But this is how things work in reality. If an officer acts illegally during a traffic stop, and you physically resist it (e.g. grab them to keep them out of your car after refusing a search), you have committed at least one crime and possibly several. Now you can really be arrested, or if the officer is afraid for their life, shot dead. Even though there was nothing behind the initial pull-over.
[1] Edit to add:
By "we" I mean people to whom the police usually show deference and respect; a group to which I belong, and with which I'm assuming there's a big overlap with HN readership. BTW this deference is part of what is covered by the term "privilege."
There is certainly another group of people who have direct experience with getting pulled over for no reason. Consider the stories told by the former police chief of Detroit:
https://www.usatoday.com/story/opinion/2020/06/11/floyd-kill...
> When I was chief, a white DPD officer pulled me over one night. He approached my unmarked vehicle and without looking at me, asked for my license and registration. Wanting to see how far this would go, I said, "Yes officer." At some point, he recognized who he had stopped and immediately apologized. My question to him was, “Why did you stop me?” He said, "I thought it was a stolen car." The officer was reprimanded for his actions.