Don’t confuse the oath of office for a binding agreement. The president is supposed to uphold the law, but they are only held accountable by impeachment.
They even have broad immunity while conducting official acts up to and including breaking the law. https://en.wikipedia.org/wiki/Trump_v._United_States_(2024)
“Trump v. United States, 603 U.S. 593 (2024), is a landmark decision[1][2] of the Supreme Court of the United States in which the Court determined that presidential immunity from criminal prosecution presumptively extends to all of a president's "official acts" – with absolute immunity for official acts within an exclusive presidential authority that Congress cannot regulate[1][2] such as the pardon, command of the military, execution of laws, or control of the executive branch.”