Holding a person for 2 years without a trial is nonsense!
Perhaps the higher courts could have imposed a time-limited bond. It reduces in time like a price in a Dutch auction. Suppose the bond is reduced by 10% on the remaining balance every month. If a miscreant gets out on the streets, then it is on the prosecutor’s office and courts who couldn’t manage to bring it to trial.
As is taking 30 years to carry out a death sentence.
Even if the courts don’t impose a limit, prosecutors should. It is a miscarriage of justice to hold a trial over someone’s head for years and then acquit them, and it is equally wrong to make witnesses and victims wait for years to testify before you finally get a conviction. Professional pride and a sense of justice should lead to a speedy trial even if the courts do not demand it.