It’s just another arm of the unconstitutional Wickard wickedness. If you have and keep the gun in your state, its constitutional participation in interstate commerce has ended. A state could constitutionally have something to say about the gun so long as it does not prohibit you from keeping one; but the US government can only get involved with that through unconstitutional action.
If the gun is made in your state, you may have an argument, although the reality is that the Courts have already ruled you do not.
Once guns are made in one state and sold in another, you have no argument. Congress can regulate how a gun made in one state is tracked and sold in another, and that is IAW the Constitution.
I'm going to try my hand at telling the Wickard case in a soundbite form.
The court found that Farmer Filburn had a complete right to plant excess. He could feed it to his livestock without penalty. In order to avoid the penalty under the law, Farmer Filburn would only have to feed the harvest to his livestock before threshing it, that is, before removing the grain from the chaff.
"Feeding before threshing" has exactly the same impact on interstate commerce as "feeding after threshing."
I haven't figured out a good soundbite to describe the legal nonsense that follows, to this day, a decision that let Farmer Filburn affect interstate commerce with no interference from the government, as long as he didn't thresh the excess of his harvest.