Washington and Minnesota’s lawsuit against President Donald Trump’s immigration executive order (EO) showcases a cavalcade of legal errors.

First, the lawsuit could have been dismissed by the district court (or the court of appeals) in whole or in part for lack of jurisdiction. Second, the district court did not give the required legal reasoning in its order to justify the TRO. Third, the court had no business enjoining the executive order nationwide, instead of just in the two states. But fourth, once the district court issued the TRO, the appeals court had no authority to touch any other aspect of this legal challenge until it reaches the next stage of litigation.

Judge James L. Robart of the U.S. District Court for the Western District of Washington granted a temporary restraining order (TRO) late on Feb. 3, ordering the federal government not to implement the president’s immigration measure.

Sunday morning the U.S. Court of Appeals for the Ninth Circuit declined to rule on whether to grant an emergency stay of that decision for almost another two days at minimum, during which the parties will file legal briefs arguing for and against the district judge’s TRO.

But there are problems with Robart’s TRO. For starters, he did not have jurisdiction to rule on at least several of the ten counts in the lawsuit.

The judicial power is defined by Article III of the Constitution, which requires that a plaintiff must have standing for a federal court to have power to rule on the merits of a lawsuit. A party has standing if it has suffered a concrete particularized injury that is traceable to the defendants and can be redressed by a favorable court ruling.

But as the Supreme Court has made clear, a plaintiff must prove that it has standing for each issue raised in the lawsuit. It is possible—not definite, but possible—that the states are correct in asserting that their Tenth Amendment prerogatives and sovereigns are being violated by the federal government.

However, the states unquestionably lack standing to bring some of the issues in this kitchen-sink lawsuit. Washington and Minnesota claim violations of the Establishment Clause and the Religious Freedom Restoration Act (RFRA), for example. Those rights can only be raised by natural persons or by corporate organizations. A state has no rights under that constitutional provision or federal statute, so cannot sue over alleged violations. And despite what Robart said, a state cannot assert the personal rights of its citizens.

The Supreme Court has reiterated countless times that when a federal court lacks subject-matter jurisdiction in a lawsuit, the only power the court has is to explain why it cannot claim jurisdiction, then dismiss the case.

That’s what should have happened for many of the claims in this lawsuit, rather than taking the extreme step of issuing a TRO.

Which leads to another problem with the TRO: Rule 65(b)(2) of the Federal Rules of Civil Procedure requires a court to “describe the injury” suffered by the plaintiff. Robart claimed that Washington and Minnesota had carried their burden of showing they had a substantial likelihood of success on the merits of their lawsuit, but never says which ones. The states obviously cannot succeed on a claim they have no standing to raise in the first place. Robart failed to provide the legal reasoning for his decision.

Next, court injunctions should never be broader than necessary to remedy the injury suffered by the plaintiffs. Those plaintiffs are two states out of 50. Robart offers no explanation why blocking this EO in all 50 states from coast to coast is necessary to take care of Washington and Minnesota.

But having made those errors, there is nothing the Justice Department can do until the TRO is superseded by a preliminary injunction (PI). A TRO expires within 14 days of being issued, unless another event overtakes it first.

Congress defines the jurisdiction of federal appeals courts. Most of the time, a party can only appeal a final judgment, which they do under 28 U.S.C. § 1291. Some events that happen in a lawsuit before final judgment can be appealed immediately in an “interlocutory appeal” under 28 U.S.C. § 1292, which lists those pre-final triggers.

But a TRO is not on that list. Federal appeals courts cannot hear an appeal from a TRO. So when the Justice Department asked for an “emergency stay” of the TRO, the appeals court generally lacks the power to grant such a stay.

Clever lawyers could try getting around this limit by characterizing the lower court decision as a PI. But that couldn’t work here.

The TRO begins with the caption, “Temporary Restraining Order.” It then includes that “the court concludes that a TRO against Federal Defendants is necessary until such time as the court can hear and decide the States’ request for a preliminary injunction.” So it’s clear this order is a TRO, not a PI.

There may be a Hail Mary argument to get a stay by petitioning the court to grant a writ of mandamus, but the issuance of mandamus is even more rare than the granting of a TRO. It would never happen.

So it appears that the president’s immigration order will not be enforced for the time being. But within the next 11 days the district court will issue a PI, which can be immediately appealed to the Ninth Circuit.

Given the liberal makeup of the Ninth Circuit, however, the Justice Department faces an uphill fight in San Francisco. More likely this issue is heading to the U.S. Supreme Court, meaning that President Trump’s EO—and immigration as a whole—could become a major topic of discussion in the confirmation process of the Supreme Court’s incoming ninth justice, Neil Gorsuch.

Ken Klukowski is senior legal editor for Breitbart News. Follow him on Twitter @kenklukowski.