If an LLM hallucinates lines of code that can't even compile, I suppose it could also hallucinate logic issues which are more difficult to track down.
Neither of those three would function nor would they throw an error. Prompts to correct itself would not improve things.
So I did the natural thing and started to debug myself. At which point, I couldn’t help but ask myself why I was debugging machine generated code when I could not be lazy and actually build it from first principles.