Alternatively, Congress could have written a simple law to amend the US Code to state something along the lines of “federal agencies shall only have the power to regulate firearms in a manner consistent with the Constitution”.
Exactly how it should be written.