Kind of unrealistic, because in any other world those are just spare parts. I have multiple barrels for all of my pistols, usually threaded for a suppressor and non threaded. I have ported and non ported barrels/slides. I have spare trigger bars, and spare springs. Because when you shoot every week and put tens of thousands of rounds through a firearm, like anything else mechanical they wear out. That includes barrels.
What you're suggesting goes completely against right to repair.
It is not illegal in the US to manufacture a firearm for personal use under federal law. The only stipulation is if you plan to use that off your own property, you must submit for a serial number.
Making and selling firearms without an FFL is what is illegal. Doesn't matter how you make it.