I'm fairly sure ChatGPT consistently writes faulty code in order to further the conversation and learn more. Anyone who uses it to write code without checking said code is mad, the AI is a dumb model - it has no concept of understanding the code