I would interpret what is happening as a de-facto trial by judge, not peers, and thus a deprivation of liberty without due process of law, which must include a trial by peers.
That doesn't stop all these uncertainties affecting the outcome ("and the prosecution would like to note that the accused didn't provide the password, pretending that he doesn't remember it/know it" can turn jurors against someone, even if its BS).
How many people were accused and convicted with BS technical certainties (but actual scientific uncertainties) like the bogus "hair matching"?
(Plus practices like the death penalty, private prisons, abuse of solitary confinement for long periods, down to contractors overcharging 10x for prison phone calls. One would compare that with the 3rd world, not the modern Western world).
If anything it needs more limitations to prosecution and uncertainties that work in favor of the state, not less.
The court system didn't make sentences too long. They were dragged there, kicking and screaming, by a polity that overwhelmingly demanded tough-on-crime statutes and tough-on-crime prosecutors, and passed laws to ensure that the courts complied.
This argument is besides the point, though. I'm not saying that contempt rules are OK because the underlying crimes require the state to prove mens rea. I'm saying, the court has for centuries been charged with ascertaining truths that are in some sense unknowable, because they depend on determining what someone was thinking. This isn't a new challenge for the court.
Tech people have a bad habit of pretending that the uncertainties that our work generates are the first uncertainties the court system has ever dealt with.
But most of criminal law turns in large part --- mens rea --- over a court making decisions about what's in the head of the accused!