For example: you were convicted of murder and escaped and were then sentenced to years on top of your original sentence, but you were later exonerated of the crime of murder; would you still have to serve the sentence for escaping? Even though you shouldn't have been there in the first place?
At the federal level, per 18 USC 751, escaping is a crime. In United States v. Allen, 432 F.2d 939 it was held that an arrest need not be lawful in order for an escape to be illegal; Laws v. US states that "This court has said that a sentence imposed for a violation of 18 U.S.C. § 751 is 'not affected by the validity of the sentences being served at the time of the escape'", giving numerous citations. I don't find cases where the escapee was exonerated; prosecutors have the discretion to not prosecute for committing a crime, so it would be hard to find a case where the legality of such a conviction was upheld (also, hard to find a jury willing to convict in such circumstances).
I called an ambulance for someone attempting suicide. The police detained him under the Mental health Act (NSW) (you go to hospital). He escaped on the way to hospital. He went to the lockup and was charged with escaping from lawful custody.
If he had been taken to hospital a minimum 6 weeks of treatment. As it was now criminal he was held overnight and probably fined.
Normally, if someone has escaped a judge or magistrate issues an arrest warrant. If he or she is exonerated, the warrant can be withdrawn(, this is not to say it should be nor that it will be). If it is withdrawn, case closed unless the warrant is activated for some reason.
If it is not withdrawn, on arrest, there will be legal proceedings against that person that will decide the outcome.
Although escaping is a crime, it should not be difficult for any good lawyer to prevent a decidedly bad outcome.