Then make the law only apply to wrongful convictions prior to the law being enacted. Don’t create a future situation ripe to be gamed.
And where is the incentive for the prosecutors not to wrongfully convict in all this?
Prosecutors are the primary source of the problem. Let them have some accountability and future problems of this sort will be reduced.
That's the only issue I have with this.
We want the guilty to be punished to the extent of the law. Punishing an innocent person accomplishes exactly nothing and is pretty much modern slavery.
In your hypothetical example, the prosecutors, judge & jury would be culpable.