In Ohio (and most states) the judge still has to take the additional - and legally necessary - step of actually dismissing the case. In 99.999% of cases, the judge will do it with no fuss, on the prosecutor’s motion. (When I was a prosecutor I once had a judge refuse to approve a lawful, appropriate plea bargain that defense counsel and I had worked out. Very unusual, but then, she was a real jerk).
Sounds like the obliging grandson had the bad luck to be appearing before a particularly hard-nosed judge. The fact that the judge sent him to prison also suggests this.