"He should never have been charged, let alone convicted," judges now say.