Habeas corpus allows you to challenge the legality of detention. If a writ were sought in this case the prison governor would present the original order of the court authorising imprisonment and the application for habeas corpus would be dismissed.
There are routes to challenge 'wrongful' detention authorised by a court, but not via habeas. Some IPP prisoners have been released by the Court of Appeal criminal division on a (very late) appeal against sentence where other factors appeared after the original sentencing. You can also challenge the refusal of the Parole Board to release you by judicial review, though this is a fairly high bar to clear.