Much like the adage that you need to be smarter to debug code than to write code, you need to be smarter to "touch up" AI generated code than to write it yourself.
The problem with AI generated code is that it contains mistakes and because of the nature of how it works, those mistakes may be entirely unlike the kind of mistakes a human would make or may be completely undetectable unless you know what the code should be doing.
The best use case for AI code generation is auto-complete. Depending on the complexity of the code, that can be sufficient to do 90% of the work of writing code, but it's very different from "solving problems" which tends to be the tricky part. It also requires the AI user to already know the code they want the AI to generate before it does it.
An interesting application of AI outside of simple code generation however is what GitHub is currently experimenting with as "code brushes", i.e. "touching up" existing code, trying to fix bugs or apply refactorings. This fits in the gap of "single shot functionality" but operates on existing code rather than requiring a blank slate.
But at the end of the day I think AI will fail to kill programming just like other attempts like WYSIWYG UI builders and COBOL have and for the same reason: competence as a programmer is not about the ability to write code but the ability to understand programs and systems, both at scale and in depth. A beginner will not write bad code simply because they lack experience in using the language, they will write bad code because they lack understanding of what the code does and how it interacts with its environment (and how that environment interacts with it in turn, e.g. UX).