On Tuesday, a three-judge panel of the US court of appeals for the ninth circuit heard argument on whether President Donald J Trump’s immigration and refugee order should go back into effect while legal challenges wind their way through the courts. Oral argument can be a fickle guide, but a majority of the panel will probably uphold a ruling that temporarily stayed Trump’s order.

That would unquestionably be the correct result.

While both parties raised technical arguments – involving who has the right to challenge this order, and whether the lower court ruling was appealable – the panel focused on the underlying issues. And rightly so. Especially in light of Trump’s direct attacks on judicial independence, this is no time for courts to hide behind malleable technicalities that obscure the profound interests at stake.

If there were any doubt left about the extraordinary nature of this legal fight and Trump’s position, the oral argument erased it.

Most notably, in a series of exchanges that frustrated the court and left the government’s lawyer stammering, the panel asked if it had the power to review Trump’s order. Each time, the Department of Justice lawyer (August Flentje) stuck to a painful strategy of dodge-and-evade, refusing to acknowledge any limits on Trump’s unilateral right to dictate policy.

For instance, when asked by Judge Michelle Friedland, “Are you arguing that the president’s decision in [this case] is unreviewable,” Flentje replied, “Yes,” adding after a long and awkward pause, “[t]here are obviously constitutional limitations …” But when pressed on what those limitations are, he retreated: “Well, I would more say that the plaintiff has asserted various constitutional limitations.”

By the same token, when asked by Judge William Canby if Trump had the power to declare “We’re not gonna let any Muslims in,” Flentje repeatedly declined to answer.

These claims to unbounded power would have struck a nerve under any circumstances. But it’s hard to think of a worse time to seek judicial deference to the presidency than after a wildly unpresidential attack on the “so-called judge” who enjoined his order. “Just cannot believe a judge would put our country in such peril. If something happens blame him and court system. People pouring in. Bad!” Trump tweeted.

Insistence on judicial respect for the president’s unique role in immigration also rings hollow when the executive branch so badly mangled the whole undertaking.

Courts are not oblivious. It has been widely reported that this executive order was crafted with little or no input from most affected agencies and experts, and that it was not subjected to standard internal and inter-branch review. Further, the initial implementation of the order caused nationwide chaos and protest, led to a rapid flurry to judicial rebukes, revealed discord and confusion within the executive branch, and harmed many innocent people.

It was therefore unsurprising the panel asked pointed questions about the president’s judgment. As Judge Canby noted, the government had failed to identify in the lower court any federal offenses committed by persons with visas from the covered nations. And Judge Richard Clifton, describing Trump’s position as “pretty abstract”, bluntly asked Flentje, “Is there any reason for us to think that there’s a real risk” to leaving the status quo in place while the executive reviews its immigration policies.

Responding to these questions, Flentje had no choice but to fall back on a general assertion that the president alone is empowered to calibrate risk in the national security field. This is a point that would usually carry great force, but that in this situation was met with well-deserved judicial doubt.

The panel appeared divided, however, on the underlying question of whether Trump’s policy is unlawful. Judges Friedland and Canby seemed inclined to agree that a series of public statements by Trump sufficiently evidenced an intent to discriminate against Muslims, in violation of the Establishment Clause.

Judge Clifton, in contrast, expressed skepticism of that position, noting that Trump’s order did not cover many Muslims living abroad and was based, in part, on prior determinations of which nations might present special security concerns.

Judge Clifton’s reasoning is unpersuasive, for reasons well stated by Ben Wittes, David Cole and Mark Joseph Stern, among others. Trump’s order is so egregiously and self-evidently mismatched with the security concerns that supposedly motivated it, and was accompanied by so many remarks explicitly referring to religious discrimination, that the only seriously conceivable purpose for the order was to make a showy anti-Muslim political statement during Trump’s first days in office. And under the Establishment Clause, that is unconstitutional.

Anticipating defeat, Flentje urged the panel to at least narrow the lower court’s ruling, so that parts of Trump’s plan could go into immediate effect. The panel did not tip its hand, but should reject that invitation.

The Trump administration has spent the past weeks rewriting its poorly conceived order on the fly, causing further disruption and uncertainty for untold numbers of men, women and children.

When executive orders on matters of national import are issued and revised, there should be significant review within the executive and Congress, followed by a period of delay, so that federal officers can be trained and people can order their lives. Courts should not allow themselves to become agents of the Trump administration in yet another round of detailed, half-baked revisions to this unlawful executive order.

The panel will probably rule this week. Whichever side loses will almost certainly seek immediate review in the supreme court, where it would take five votes to reverse the ninth circuit’s decision. In all events, full review of Trump’s executive order will continue apace in federal courts around the nation.

Challengers to Trump’s order might well win this battle, but a war looms on the horizon, with extraordinary implications for the United States and the world.