People v. Superior Court (Sanchez), 223 Cal.App.4th 567, 167 Cal.Rptr.3d 115 (3d Dist. Jan. 29, 2014) (granting prosecution petition for a writ of mandate challenging the trial court's order reforming a plea bargain detrimentally to the People by reducing the penalty to the term of imprisonment authorized by law for the crime, where the trial court exceeded its jurisdiction by reforming the negotiated plea to conform with the applicable law because the reformation denied the People the benefit of their bargain).
Note: In this case the defendant agreed to a plea bargain for a sentence of 25 years to life without possibility of parole on one count of attempted murder. The judge found that the statutory punishment for this offense is a term of 25 years to life with the possibility of parole, which set the minimum term at only seven years. The trial judge accepted the plea though even though it benefitted the defendant and was detrimental to the People. The People filed a writ and the Court of Appeals (on instructions from the Supreme Court) reversed and ordered the plea agreement rescinded.
If the defendant can establish that a non-deportable plea bargain was entered into, and that was the purpose of a material term of the agreement, but it is later discovered to be incorrect as a matter of law in that both sides were mistaken, then the agreement can be rescinded. Thanks to Michael Mehr.