That is incorrect.. Even the President (and our Prime Minister) must act in accordance with the respective Constitutions.

In the US of A that principle was established in the seminal  Supreme Court decision of Marbury v. Madison, 5 U.S. 137 (1803).

In Canada we explicitly conferred that power of judicial review of legislation and executive actions upon the courts when our Constitution was patriated in 1982. See  S. 24 and S. 52 of the Constitution Act, 1982 when we set aside the doctrine of Parliamentary Supremacy.  Prior to that our courts were confined in constitutional matters to determining if the impugned legislation or action was properly within the respective jurisdictions of Parliament or a provincial legislature per the division of powers.