The problem with AI generated code is that the code the data model was trained on almost exclusively comes from public repositories. And there's a lot of repositories that are absolute dog $h!t or out dated. Crap in equals crap out.
It's also why model collapse is not a thing despite everyone wanting it to be.
That's why the code you get from the post-November models is so much better than older models.
In the Doom engine, for example, he has hard coded lots of things directly in the C engine code that really should be part of the regular game code.