Donald Trump has been mocked for threatening to sue Nancy Pelosi and Adam Schiff to prevent his impeachment, but don’t laugh too soon.

The Supreme Court may be poised to legitimize Trump’s desperate effort to stymie Congress’ impeachment investigation. The judge Donald Trump appointed to take Brett Kavanaugh’s place on a D.C. federal appeals court may have just blazed a trail toward a high court decision that could cement the court’s role as Trump’s protector, and gravely tarnish the Supreme Court’s reputation in the process.

Last week, Judge Neomi Rao—a prominent conservative legal scholar, former Trump administration official, and long-rumored future Supreme Court nominee herself—dissented from a decision upholding a congressional subpoena to Trump’s accounting firm for tax returns and other financial information he has assiduously sought to hide since the 2016 campaign.

Congress issued the subpoena before commencing its impeachment investigation into the president. Accordingly, the legal issue before Rao and her appellate court colleagues was whether Congress’ authority to engage in legislative oversight was sufficient to justify the subpoena. Trump’s lawyers argued to the court that such a request could only be justified as part of an inquiry into whether Trump engaged in potentially impeachable high crimes or misdemeanors.

As the well-reasoned majority decision demonstrated, however, Supreme Court precedents provide that Congress can conduct investigations that directly implicate and concern illegal conduct by the president and other Executive Branch officials in order to consider potential legislative options available to prevent misconduct in the future. Yet Judge Rao disagreed, in an opinion that many constitutional scholars observed was squarely at odds with settled law.

It may seem initially puzzling why Rao devoted the effort to providing an unconvincing argument that Congress is without the ability to conduct an investigation concerning misconduct by a government official in its legislative oversight role. After all, Congress has now begun an impeachment investigation that should ultimately allow the House to obtain the materials at issue, even under the argument Trump initially proffered to the appeals court.

But Rao’s agenda clearly extends beyond the subject at hand. Her dissent appears calculated to provide judicial credence to the contention of Trump’s White House Counsel Pat Cipollone that it is “constitutionally invalid” for Trump to be impeached.

Article I of the Constitution grants the House exclusive jurisdiction over presidential impeachment proceedings. Accordingly, Trump’s threat to “sue” to prevent his impeachment is as ridiculous as it appears. Indeed, in her dissent, Rao concedes that disputes regarding impeachment proceedings may not be “justiciable.” Yet Rao’s dissent nonetheless implies that Trump may be able to turn to the courts to frustrate, and challenge the legitimacy of, Congress’ impeachment investigation nonetheless.

Like Trump, Rao asserts that the Constitution provides the president with a number of “enhanced protections” and procedural “safeguards” in connection with a House impeachment inquiry. As impeachment scholar Frank Bowman has explained, however, this claim is “specious.” While the Supreme Court has indicated that there may be some minimal procedural requirements for the Senate trial of an impeached government official (which amounts to a type of adjudication), there are no constitutionally mandated procedural standards or requirements for an impeachment by the House (which is the rough equivalent of a pre-trial indictment), let alone “enhanced protections” in connection with a House investigation preceding an impeachment vote. Furthermore, as Bowman explains, even if the Constitution imposed such standards, courts would not have any proper role in enforcing them.

Yet embedded in Rao’s opinion is a hint of how the Supreme Court might nonetheless ride to Trump’s rescue, should it choose to adopt her (and Cipollone’s) extraordinary contention that Trump has “due process” rights in connection with an impeachment investigation. Just as Rao argues that the courts should police “illegitimate” legislative oversight investigations by refusing to enforce congressional subpoenas, her opinion likewise can be read to suggest that federal judges could stymie a “constitutionally invalid” impeachment inquiry by backing up Trump’s efforts to prevent Congress from obtaining access to witnesses and evidence.

Trump’s avowed attempt to stonewall the Ukraine investigation has faced early reverses, as key witnesses—such as former Ambassador to Ukraine Marie Yovanovitch and presidential adviser Fiona Hill—have complied with congressional subpoenas, despite White House efforts to limit their testimony.

Nonetheless, Trump remains committed to preventing Congress from questioning key witnesses and obtaining critical evidence. For example, according to Adam Schiff, the State Department is withholding potentially inculpatory documents, while Defense Secretary Mark Esper has reneged on a previous commitment to comply with a congressional subpoena at the instruction of the White House. Furthermore, Rudy Giuliani’s attorney recently responded to a congressional subpoena by “adopt[ing] all the positions set forth in” Cipollone’s letter, and flatly refusing to comply.

Accordingly, it is highly likely that the Trump’s administration’s defiance of Congress’ impeachment subpoena power will reach the Supreme Court, possibly very soon.

If the high court is asked to rule upon Trump’s stonewalling, a majority of conservative justices may be tempted to endorse the Cipollone/Rao claim that Trump is entitled to procedural “safeguards” from impeachment, and to employ that claim as a rationale for excusing Trump’s defiance of Congress’ subpoenas.

One possibility is that the court could allow Trump to withhold witnesses and evidence unless Congress accedes to his vague demands for “procedural” protections against impeachment. Although such a ruling would not prevent Congress from impeaching the president, it could provide a stamp of legitimacy to Trump’s defiance that would be of great political value to the president.

If, however, a conservative Supreme Court majority chooses to legitimize Trump’s effort to prevent the Congress from holding the president to account for his abuses of power, then the high court would be openly serving as political ally and protector of the president, and could sacrifice its own legitimacy in the process.