Well put.
The fundamental flaw is in trying to employ nondeterministic content generation based on statistical relevance defined by an unknown training data set, which is what commercial LLM offerings are, in an effort to repeatably produce content satisfying a strict mathematical model (program source code).
if you’re a heavy user you should pay for a monthly subscription for Claude Code which is significantly cheaper than API costs.