Had similar experiences with Python. I started requesting simple functions I could create on my own, and it worked fine. Compounding them even worked to a degree.
However, it eventually just… failed. Horribly.
What I’ve learned that works most of the time is copying the entirety of the code (yuck), and telling it to tweak it a bit. That seems to work more often than not.