Justice Clarence Thomas was the only member of the court to side with Missouri on Friday.
The law would impose a fine of $50,000 on an officer who knowingly enforces federal gun laws that don’t match up with state restrictions.
Federal laws without similar Missouri laws include registration and tracking requirements and possession of firearms by some domestic violence offenders.
The court expanded gun rights in a 2022 decision authored by Thomas. It is hearing arguments next month in the first case stemming from last year’s ruling. An appeals court invalidated a federal law that aims to keep guns away from people facing domestic violence restraining orders.