Not sure what I can say but the LLMs simply do not write good code without tons of handholding. As a C developer most LLMed patches I have seen the last couple of months have been awful and the few good ones I know from the author themselves that they did a ton of iteration and/or manual cleanup. Maybe they are less bad at writing other languages.