Polanski claims that the judge agreed to a plea bargain, at which time he pled guilty, at which time the judge changed his mind and was going to increase his sentence, so he fled.
Apparently the Swiss asked for sealed testimony regarding Polanski's sentencing -- which I'm guessing would help evaluate whether Polanski's claim of being screwed with by the American judiciary has any merit. The U.S. didn't provide the testimony, so the Swiss refuse to extradite.
This seems quite reasonable to me.
Sentencing is one thing which is 100% up to the discretion of a Judge. In a plea negotiation the most a DA can do is give a sentencing recommendation. A vast majority of the time the Judge agrees to it, but he is not bound by law to do so.