court systems are complicated, there are so many judges in this country in so many specialized courts and so many cases taken that there's bound to be some error along the way, but you can always appeal to a higher court if you really need to (until you get to SCOTUS), and if they take the case then hopefully they can change the ruling. having unelected judges (like federal courts and certain states) means that they don't have to worry about being politicians that have to appeal to the masses as republicans or democrats, they can just be judges. most of these weird cases you see probably happen in local court systems where facts are hazy. for the most part, juries and judges are on average, reasonable means of interpreting law for a given set of facts, but obviously, people are human and make mistakes.