I am a professional for forty five years.
Your description of the experience tells me that you have not figured out how to do it correctly.
I NEVER have bad experiences like that. I absolutely DO create production grade software reliably every day.
Treat it as collaborator instead of as a servant. You will get much better results.