3D printing is one of those things that will be pretty much essential for successful manned missions farther away than the moon.
Once 3D printing develops from it's current "stone knives and bearskins" stage of development and reaches the 21st century, sure. But even once the far off day arrives where we can print in a wide variety of materials (I.E. those suited to the task of the parts being replaced) and assuming it reaches the stage where the printed parts don't require substantial hand finishing for precision... it's highly unlikely to be able to print electrical and electronic components, particularly the IC's that will represent a very large component of the failed parts.
Being unable to fix broken things will be fatal if the nearest spare parts are nine months away, and a 3D printer or two can, conceivably, replace a great many individual spare parts....
That's why you carry spare parts with you. And why you "design for maintenance". And why you do extensive development and testing beforehand to figure out what parts are most likely to break. And design parts to be reliable. And reinforce the parts where you can. And... well, there's a vast amount of and dedicated sub fields of engineering dedicated to this kind of thing. No professional goes off the beaten path with the attitude of "oh well, I'm just gonna die if something breaks". There's a reason why "lack of spares" pretty much has never come up in any serious discussion of lunar colonies or missions to Mars. (Not until the amateurs, being largely blithely unaware of how the world works, started playing around with 3D printing.)
Disclaimer: In addition to years of actually seriously studying the space program... I've lived where high reliability could mean the difference between life and death and spares were limited to what was on hand as there was no parts place up on the main road or next day mail. (I.E. a crewman on an SSBN.)