Those rules are not law. Any statutes, ordinances, rulings, regulations, or other rules which were unconstitutional when written are and always have been illegitimate. Such rules were not, and are not, law.
That doesn't mean people who refuse to comply with the illegitimate demands made by such rules won't be unjustly punished for such refusal, but the ability of government agents to impose their illegitimate will does not make that will legitimate.