One thing about LLMs is that, at least with JavaScript, Perl, PHP and HTML pages, they produce different code/results each time, even when given the same prompt.
This behavior can lead to many malformed files, but if I keep at it (and not only with one LLM, but usually several), more often than not I’ll eventually get working code.