The law on sanctioning Presidents for contempt remains unsettled. As a matter of legal doctrine, there are powerful constitutional arguments, rooted in the separation of powers and checks and balances, on both sides. As a matter of prudence, both judges and administrators go out of their way to find accommodations that avoid raising these constitutional arguments. As a result, the underlying law has not been litigated, and thus remains unsettled.
(Given the way the Executive branch works, Presidential policy often comes through orders issued by executive agencies. For that reason, to answer your question, we need to look at how courts deal with agencies as well as with the President himself.)
Yale Law professor Nicholas Parillo recently looked at over 15,000 judicial decisions and dockets get a handle on exactly this issue. He published his results in the Harvard Law Review, with a more reader friendly summary here.
As he points out, judges have three ways of punishing contempt:
1) Contempt Fines Against the Agency as an Institution: Because of sovereign immunity, it is not clear whether fines would be constitutional. However, as a matter of fact, “the judiciary has carefully avoided ever getting to the point where a federal agency incurs a contempt fine.”
2) Imprisonment of the Agency Official: Again, there are arguments going both ways, but as a matter of fact: “Imprisonment has occurred only twice, never for more than a few hours, and in both instances, the biggest losers proved to be the judges, who ended up off the cases…”
3) Fines Against the Agency Official: Again, this raises various legal issues, but most fines end up being reversed on narrow, case-specific grounds on appeal. In the end, only three fines were upheld, and all were much less than $10,000.
As you point out, the contempt power seems a natural way for courts to deal with agencies that disobey court orders. According to Professor Parillo's exhaustive study, when agencies disregard court orders, we expect to see the following:
Courts will often find agencies in contempt; but,
Courts will almost never sanction agencies or officials for contempt; and,
Even without sanctions, the threat of a contempt citation will usually be enough to get agencies to increase their compliance with court orders.
Indeed, if you look at the record of the Trump administration and the courts, this prediction has been borne out.
(The issue of Presidential contempt has been discussed quite a bit recently, for example, here and here.