I have reviewed the transcript of the deal that was put on the record on August 8, 1977 and it appears to me that it was a done plea deal contingent upon a psychiatric evaluation, which apparently found that Polanski should not serve time. It's very unusual for a Judge to approve a conditional plea deal on the Court record like this, have the conditions met, and then indicate he was going to do something else at sentencing, especially when the prosecution, defense attorney and victim's attorney are urging acceptance of the deal. It's rare that it would not be approved unless it was somehow determined to be in violation of some important public policy of the State of California, although what is interesting is that the prosecutor alludes to those policy considerations in the transcript of the plea deal. It seems like Judge Rittenband did "renege" on a done deal.
I think that between the time of the plea deal going on the record in August 1977 and the time of sentencing in February 1978, the Judge felt some political pressure to imprison and then deport Polanski. If Polanski had stuck around for sentencing, he may have ended up getting imprisoned and then quickly deported, which in effect would have achieved the exact same practical result as what ended up occurring by him fleeing to France. The problem, both in Polanski's mind and the Judge's, is that even if he was briefly imprisoned where such prisoners are normally sent, the chances of him getting ass-raped or killed would have been very high. Apparently, the Judge was very worried about this, due to the high profile nature of the case. However, it's not clear why he reneged on the plea deal or at least made comments that he would at the sentencing hearing. He must have felt some pressure from somewhere above him.
From what I read, Polanski claimed the sex was consensual, even though by law it cannot be, and that the girl did not respond negatively to his inquiries about whether she was enjoying DATY. These "defenses" are legally meaningless, and I am sure his attorneys told him that. It's also possible that when this got out in the press at that time, it created a wild public backlash against Polanski, because they are also somewhat hideous admissions of his conduct.