You can totally fix AI-written code with AI. You tell it something is wrong, it tries to fix it.
I did a recent experiment with AI writing a document format converter and that's exactly what I did. It wrote some code, I checked the output, found a formatting issue or similar, asked it to fix it, repeat. It works unreasonably well and with Fable the final code isn't even bad.