Even Nappen ponders whether it’s unlawful for legislators to vote for a “Firearms Freedom Act,” such as the one in New Hampshire with threatens federal officials with jail time and crimes for attempting to enforce federal gun laws.
Generally speaking legislators enjoy some form of legislative immunity, which means they can’t be sued for their actions as legislators. But legislative immunity for criminal matters is typically something defined by the Constitution, and in no case that I know of is such immunity unlimited. There’s certainly nothing in the federal constitution that immunizes state legislators from being subject to federal laws.
There is no doubt that a law criminalizing the interference of federal officials in the execution of their lawful duties is among Congress’ enumerated powers, because it is a “necessary and proper” exercise of their power to make and enforce laws under the authority of the Constitution.
This is an interesting question, and I can’t find anything that says the answer is definitely no, that it is not technically illegal. States do have sovereign immunity, and I would imagine state lawmakers could seek protection under that idea. But I can’t find any case that suggests state lawmakers can’t be criminally liable for passing a law which violates a federal criminal statute. Anyone else know?