This commentary was published in partnership with the Marshall Project, a nonprofit newsroom covering the U.S. criminal justice system.

A federal appeals court recently freed a man who had been incarcerated nearly seven years awaiting trial. Although the court labeled Joseph Tigano III’s pretrial incarceration “egregiously oppressive,” it suggested there was no one factor to blame. “Years of subtle neglects,” the court wrote, “resulted in a flagrant violation of Tigano’s Sixth Amendment right to a speedy trial.”

Tigano’s case was no Agatha Christie mystery.

Tigano’s case fits a familiar narrative of clogged courts and bureaucratic indifference. But there is one important complication coverage has overlooked. While the appeals court and subsequent media portrayals suggest that prompt trials are the solution to cases like Tigano’s, the real fix is long-delayed, bipartisan sentencing reform. That is because the problem in Tigano’s case was not neglect, but a 20-year mandatory-minimum sentence that loomed over every decision in the case.

Tigano’s case was no Agatha Christie mystery. Federal agents found 1,400 marijuana plants growing in Tigano’s residence. What’s more, three separate agents testified that Tigano confessed that he grew the marijuana. That’s a tough case to fight. He was going to lose at trial, it seemed, and he was going to lose big.

While many states are lining up to cash in on marijuana legalization, federal law still dictates that a person who grows “1,000 or more [marijuana] plants … shall be sentenced to a term of imprisonment which may not be less than 10 years.” That’s a 10-year mandatory prison term for growing marijuana—doubled for anyone, like Tigano, with a prior felony drug conviction.

That is why the attorneys and lower court judges in Tigano’s case overlooked the speedy trial rule. They were not neglecting Tigano. They were, instead, repeatedly delaying his case—to the point of ordering three needless mental competency examinations—in the hope that Tigano would agree to a plea deal. With 20 years on the horizon, everyone, including Tigano’s own attorneys, could put up with an otherwise unconscionable delay that would ultimately be deducted from his eventual sentence.

Tigano, however, insisted on his constitutional right to a trial. After seven years, he finally got it. There were no surprises. The jury convicted and the judge sentenced him to 20 years in federal prison. Of course, no one expected the final twist. On appeal, the lengthy pretrial delay set Tigano free.

That’s not going to work for future defendants caught in Tigano’s predicament. Most will take plea deals to avoid mandatory sentences, even if they are innocent. Others will insist on a speedy trial and get it, along with the accompanying crushing prison term. But there is one thing that can consistently fix this form of injustice: eliminating mandatory minimums.

The appeals court’s opinion says that “no single, extraordinary factor caused the cumulative seven years of pretrial delay.” That’s wrong. The 20-year mandatory sentence for growing marijuana ignited all the chaos in Tigano’s case. That’s the dirty secret about mandatory minimums: They don’t just lead to unjust sentences; they distort proceedings in countless cases where they are never imposed.

Most alarmingly, harsh mandatory sentences pressure even innocent people to plead guilty to avoid long prison sentences. And for the bold few who still go to trial, like Tigano, these laws prevent judges from imposing fair sentences.

Tigano’s case is an embarrassment to the criminal justice system for a whole host of reasons. But it could have a positive impact if it helps push Congress to enact long-awaited sentencing reform. Among the principles that a bipartisan group of senators agree on is reducing the number of mandatory minimum sentences. The Tigano case illustrates why this principle should appeal to the entire Congress.

Mandatory minimums don’t just ensure harsh, often disproportionate sentences. They also cause massive distortions in the criminal justice system, leaving it a pale shadow of this nation’s ideals.