That's why we have an appeal process.
Ever read about the Edwin Wilson case. Prosecutors knew he was innocent and hid the proof of his innocense from the court in order to get a conviction.