It happens under US law, too, not all that frequently but not an incredibly rare event, either.
In the United States, as a general principle a guilty plea waives all non- jurisdictional claims for appeal. But the plea itself can be challenged – for example, the defendant might claim he was never advised that he had a right to have the charges against him decide by a jury, or that he was coerced into entering his plea.
To guard against that, a judge in the US will typically engage in an on-the-record discussion with the accused before accepting the plea, known as a colloquy, in which he walks the accused through a series of questions:
“You understand that you have a right to a trial by jury, and that by entering a plea of guilty, you are giving up that right?”
“You understand that the prosecution must prove each and every element of the crime against you beyond a reasonable doubt, and by pleading guilty you are giving up your right to require that they do this?”
“You understand that by pleading guilty, this court may sentence you to xxxxxxx?”
And so on. In addition to the colloquy, the judge must establish, on the record, the factual basis for the plea – some statement of evidence apart from the accused’s plea upon which the plea would rest. Typically this is met by requiring a proffer from the prosecutor as to the basic evidence he would present if there were a trial, sufficient to show guilt.
The failure to engage in a complete colloquy can create grounds to withdraw a guilty plea, as can the lack of a factual predicate for the plea. And if the court refuses to permit a defendant to withdraw his plea, the defendant can appeal that denial.