Unfortunately, this is how the change evolves.
In the early stages, what you are talking about is very common, because the police don't acknowledge that the law applies to them, until it is forcefully jammed down their throats via the courts; ie; lawsuits.
People have to be willing to SUE these fuckers.....and a lot of people would rather take the easy way out and just forget the wrong they've been done, and go along......this is what they count on.
If the law says it's decriminalized, then, by god, the cops are liable in civil court when they prosecute in a contrary fashion.
This means that they are liable, civilly ($) when they violate the written law, but these violations MUST BE PURSUED in court.
They can be sued, and you can get MONEY from them, as this is the civil remedy available to you when the cops violate the written law.
It's called 'compensatory damages' and 'punitive damages'.
You can force them to pay for your lawyer, and the court costs, and pay damages.
When the law is on the books, you have a rock-solid case, simple as that, but it M-U-S-T be pursued.