Only a person of science or other black/white thinker would assume that law and procedure was an "essentially mechanical process." I once imagined it that way too. The very first thing a law student is taught is that everything is a grey area: laws are left vague deliberately in order to be interpreted by judges; evidence and procedure are negotiable; everything is subjective. The legal framework is only that, a framework. The legal machine is far, far from deterministic. It is designed from the top down to be discretionary.
Otherwise you'd more often run into situations where you couldn't prosecute someone because a statute didn't spell out their exact actions even though in spirit they had violated it.
What happens if you're in a grey area? You spend hundreds of thousands or millions of dollars defending yourself, and you might be found innocent of the more serious charges, but there's a good chance you'll be convicted on one or two minor charges. You're still out the money you payed to your lawyers, and the prosecutor gets to say, "We didn't get the outcome we wanted, but the evildoer was still held to account for his crimes."
Yeah, the reality for the accused is that the system is rather black and white. Either you are not on their radar... or you are fucked. How fucked you are is really the only gradient here.
I actually agree with both of you. The system is so subjective that if you are rightly or wrongly ensnared by it, you always lose at a minimum, money. Civil cases are even more likely to occur because effectively anyone from an employee to a patent troll can play "prosecutor" and again the question is only how much it'll ultimately cost.
Otherwise you'd more often run into situations where you couldn't prosecute someone because a statute didn't spell out their exact actions even though in spirit they had violated it.