I feel like we'll eventually all agree that it's a mistake to ask a generalist LLM for code. I've found ChatGPT to be fine at talking
about code - like describing the difference between two APIs - but for generating nontrivial chunks of working code I think it's miles behind Copilot and similar.
And I assume that's just because, y'know, ChatGPT can write sonnets and translate Korean to Swahili and whatnot. It's amazingly broad, but it's not the right tool for the comparatively narrow problem of code generation.