You can’t manufacture a gun for somebody else unless you’re a registered gun manufacturer. You can only make one for yourself. You can hypothetically sell/give a printed gun to someone if when you made it you didn’t intend on selling or distributing it, however many states require you to transfer that firearm via a dealer.
You would have to give/loan your cancer patient a 3d printer and maybe suggest a URL. They would have to construct the firearm themselves without help.
Organized crime worries about legal issues all the time, and their whole purpose is crime.
Limiting liability, and plausible deniability, is a cornerstone of literally getting away with murder.