United States v. Alvarez is the relevant case law here.
There are tons of on-the-books statutes that are not in line with Alvarez. And we should presume they would fail in a full legal challenge if a full legal challenge to them were mounted. But not everyone has the resources or dedication to try and take something all the way to the totally-political, capricious SCOTUS.