Sometimes, ChatGPT just writes really nonsensical codes. It manufactures methods that don't exist in an API and when you point it out, it apologises. It's not the best tool for a beginner yet. For an experienced engineer, it is just a tool to bounce off ideas