President Trump was lucky. The three-judge panel consisted of Judge Niemeyer appointed by President G.H.W. Bush, Judge Quattlebaum appointed by President Trump, and Senior Judge Shedd appointed by President G.W. Bush. If the panel had consisted of Clinton/Obama-appointed judges, the decision might have been different.
Is there a danger of an en-banc rehearing? There are six Republican-appointed judges, eight Democrat-appointed judges, and one judge who was originally appointed by President Clinton and consequently appointed by President George W. Bush.
The MD AG will appeal and and ask for en-banc hearing, where it will to the other way (all political, law be dammed). It will go to the supreme court, who will refuse to hear it as Roberts will avoid the controversy. In the end, Trump will lose this one.