Would the Court of Appeal ever make a hospital order when the patient no longer meets the detention criteria?

Continuing the discussion from Lawfulness of earlier first statutory referrals by the MOJ:

I’m not sure that point (b) is right – but this made me remember more details of an old case, which maybe has been resolved in the years since. I had a patient who was considering appealing his IPP sentence, and whose RC would have been supportive and would have recommended a s37/41 restricted hospital order instead. At the same time he had tribunal proceedings and the RC was supporting a hypothetical conditional discharge decision so that a Parole Board could take place.

I wondered what would happen if the case got to the Court of Appeal between the tribunal and the Parole Board. The tribunal and RC would have decided that the MHA detention criteria were not met. Would or could the Court of Appeal impose a s37/41 order at that point, knowing that the doctor was already recommending conditional discharge? I thought maybe they would, but wasn’t sure how, and anyway in his case an appeal would have taken longer than the tribunal.

Also, what would they have done if he’d been released on licence by the time of the appeal? Could they impose a s37/41 order and somehow have him immediately be a conditionally discharged patient? A criminal barrister thought so, saying the court would be “pragmatic”, but I couldn’t see how.