A lot of these people think they ARE the law. They can just do whatever they want in "their" courtroom. They're judge, jury, and executioner inside those four walls. And honestly, they basically are. There's very rarely any repercussions for them and it's up to the person getting fucked over to secure an appeal or other legal avenue toward legal fairness which at best means a lot of time and money. If the state loses a case I honestly think the defendant should be reimbursed for his legal expenses and time he had to forfeit to defend himself from charges that couldn't stick.