Suppose a crooked prosecutor framed someone and was determined to get a conviction. So he built an entire case on tainted, circumstantial evidence, and testimony from witnesses who had their reasons for wanting the guy in jail. Suppose the prosecutor ignored or hid exculpatory evidence and colluded with the judge to prevent the defendant from presenting a robust defense or cross-examining adverse witnesses.
You know what would happen--at least in a fair and just society. The victim would be exonerated and compensated. The prosecutor and judge would be disbarred, fined and jailed.