That would be justice, but it would be a tough case to bring. Generally the judiciary is personally insulated from the consequences of its decisions. Prosecutors, too. In law school, I read every single death penalty appellate case over a 10 year period in Louisiana. It was a amazing how many of them were overturned after some outrageous behavior on the parts of prosecutors and judges (Harry Connick Sr, the DA of New Orleans Parish was notorious for withholding exculpatory evidence, which is not just outrageous but illegal). There were cases where judges fraternized with jurors (sending them liquor and taking them out for lavish lunches) and all kinds of things that would make your head spin. However, because once the trial is over, the prosecutor and trial judge are done with the case and there is no consequence that would incentivize them from continuing to get bad convictions. If a conviction is overturned, both the prosecutor and judge should face consequences if it can be shown that they knew the conviction was bad. There needs to be a functional feedback mechanism.