https://www.supremecourt.gov/opinions/21pdf/21-511_o75p.pdf
The ruling reads, in part, that
A transportation order that allows a prisoner to search for new evidence is not necessary or appropriate in aid of a federal courts adjudication of a habeas corpus action when the prisoner has not shown that the desired evidence would be admissible in connection with a particular claim for relief.
Twyford's request (and lower courts' upholding) was under the All Writs Act which was passed in 1911.
The All Writs Act authorizes federal courts to issue all writs necessary or appropriate in aid of their respective jurisdictions and agreeable to the usages and principles of law.
Twyford was tried and convicted of aggravated murder, kidnapping, robbery, and other
charges in the murder, mutilation and disposal of Richard Franks. Twyford confessed to the crime claiming that Franks had raped his girlfriends daughter and the killing was in revenge.
His conviction and sentencing was upheld upon appeal.
Most recently, Twyford "claimed that his trial counsel was ineffective for failing to present evidence of a head injury Twyford sustained as a teenager during a suicide attempt" (which was a self-inflicted gunshot to the head) and that this injury left him unable to make rational and voluntary choices.
Twyford moved for an order compelling the State to transport [him] to The Ohio State University Medical Center for medical testing necessary for the investigation, presentation, and development of claims.
The District Court ordered that he be transported to the OSU Medical Center and the Appeals court upheld that ruling.
The State appealed on the grounds that the lower courts erred in 2 ways
First, the State contends that the All Writs Act does not authorize the issuance of transportation orders for medical testing at all. Second, the State argues that the transportation order was not necessary or appropriate in aid of the District Courts jurisdiction because Twyford failed to show that the evidence he hoped to find would be useful to his habeas case.
The dissent by Justice Breyer joined by Justices Sotomayor and Kagan is really convoluted and not quickly and easily summarized here. The separate dissent by Justice Gorsuch is really quick and to the point:
...it became clear a potential jurisdictional defect threatened to preclude the Court from reaching that question (whether a district court may order a State to transport a prisoner to a hospital for testing). The District Courts transportation ruling was an interlocutory order, not a final judgment...
...I would have dismissed this case as improvidently granted when the jurisdictional complication became apparent.