The justification for federal jurisdiction is the commerce clause. But it doesn't automatically apply to every firearm; the connection to interstate commerce must be real for the law to apply.
In United States v. Lopez (1995), the Supreme Court held the following when striking down the related 922(q) which at that time banned firearms in schools zones but did not have a clause about interstate commerce (emphasis mine):
... although this Court has upheld a wide variety of congressional Acts regulating intrastate economic activity that substantially affected interstate commerce, the possession of a gun in a local school zone is in no sense an economic activity that might, through repetition elsewhere, have such a substantial effect on interstate commerce. Section 922(q) is a criminal statute that by its terms has nothing to do with "commerce" or any sort of economic enterprise, however broadly those terms are defined. Nor is it an essential part of a larger regulation of economic activity, in which the regulatory scheme could be undercut unless the intrastate activity were regulated. It cannot, therefore, be sustained under the Court's cases upholding regulations of activities that arise out of or are connected with a commercial transaction, which, viewed in the aggregate, substantially affects interstate commerce. Second, § 922(q) contains no jurisdictional element that would ensure, through case-by-case inquiry, that the firearms possession in question has the requisite nexus with interstate commerce. Respondent was a local student at a local school; there is no indication that he had recently moved in interstate commerce, and there is no requirement that his possession of the firearm have any concrete tie to interstate commerce. To uphold the Government's contention that § 922(q) is justified because firearms possession in a local school zone does indeed substantially affect interstate commerce would require this Court to pile inference upon inference in a manner that would bid fair to convert congressional Commerce Clause authority to a general police power of the sort held only by the States.
The constituionality of 922(g) was later also challenged in court, with a different result. In National Ass'n of Government Employees v. Barrett, (N.D. Ga. 1997), the court upheld the constitutionality of 922(g), stating (emphasis mine, some citations shortened):
Plaintiffs first assert that Congress exceeded its authority under the Commerce Clause with the enactment of § 922(g) (9) and that § 922(g) (9) is thus unconstitutional. In making this assertion, plaintiffs rely on the Supreme Court's decision of United States v. Lopez, in which the Court held that Congress exceeded its authority under the Commerce Clause by regulating the mere possession of a gun. Plaintiffs' reliance on this decision is, however, misplaced. Section 922(g) (9), unlike the statute at issue in Lopez, contains a jurisdictional element, which requires the government to demonstrate that the firearm was possessed "in or affecting commerce" or received after having "been shipped or transported in interstate or foreign commerce." This element is fatal to plaintiffs' facial challenge to the constitutionality of § 922(g) (9). See, e.g., United States v. McAllister, (upholding the constitutionality of § 922(g) (1), which makes it unlawful for felons to possess a firearm, because it contained a jurisdictional element); United States v. Turner, (noting that every court of appeals "has held that the jurisdictional element of § 922(g) provides the requisite nexus with interstate commerce that § 922(q), [the statute at issue in Lopez,] lacked"). Accordingly, defendants are entitled to dismissal of plaintiffs' claims to the extent that those claims are brought under the Commerce Clause.
I think it's clear from these decisions that the interstate commerce nexus is required for this or any similar law to be constitutional. This isn't a case like Gonzales v. Raich; the firearm is legal to sell across state lines for most people, just not for felons, and so its mere existence can't affect interstate commerce.
So, my conclusion is that a gun made totally in-state, with in-state parts, would not violate this law - and furthermore, Congress cannot constitutionally modify the law to change this.
But as the court in State v. Wahl said:
We also note that the market in firearms is heavily interstate in nature, even international in character, and it would be indeed rare that a firearm, or at least some of its component parts, would have never moved across state lines... Indeed, no more is required than a minimal nexus that the firearm had been, at some point, in interstate commerce.
So it might be difficult to find a gun that doesn't violate this law. Given that it is probably also a violation of state law for a felon to possess a gun regardless of where it was manufactured, I don't see felons going around using in-state guns just to avoid a federal charge on top of the state one.