That may be so but why do judges tell that to a person who says they are not guilty and they still stick to that. It is meaningless to them as they still maintain their innocence. They are empty words.
Yes, but you can't see it as one simple situation, it is either one or the other of two more complicated situations.
The first and most likely with a person found guilty after a plea of not guilty is that they are indeed guilty and they further compounded their crime by not being contrite and honest about it and pleading guilty, as they should have if they were not going to also lie. So in this first possibility they are found to be a bad person for committing the crime and a badder person for wanting to avoid being found guilty when they indeed were, and also they were prepared to lie and create a false narrative in order to try and get away with their crime.
I find nothing wrong with giving that person a stiff or even stiffer sentence.
The second less likely possibility, but still an all too possible scenario, is that an innocent person was charged and they rightfully plead not guilty but a miscarriage of justice occurred and that innocent person was found guilty. So in this second possibility it is really semantics to call it unjust that they get a 2.5 year sentence because they plead not guilty as opposed to a 2 year sentence had they plead guilty. In either case the difference is a small injustice compared to the real injustice of incarceration an innocent person in the first place.
And the truly innocent person should never plead guilty or admit guilt or regret ever as it terminates the appeal possibilities. In fact, I have no sympathy for any innocent person, no matter the pressure put on them, who falsely pleads guilty for a plea bargain or lesser sentence. Because, even if they were innocent of the original crime, they just became one of the worst types of criminal when they plead guilty to a crime they didn't commit - a perverter of the course of justice. They are just as bad as if they bribed a judge or tampered with a jury.
