Yes, this is not surprising given that it is a LLM. ChatGPT writing code is pretty much like someone trying to remember what they saw in some tutorial at some point without *really* understanding what it is doing.