Windows Copilot and ChatGPT are the best so far. I was using ChatGPT more at the start but now I find Copilot the first I go to, pick up from previous conversations since it has some frame of reference.
Your observation is correct, it does make lots of mistakes even sometimes uses the wrong syntax/language format. My advice is use it as a learning tool, give it very small functions and learn from it so you understand what you are building as you go since you will need to debug it when it goes wrong, and it probably will at some stage. Personal advice take it or leave it: Once you understand it delete the entire function and re-write it yourself.
I also have a hunch that its learning from my code since it seems to be giving better results now and even calls me James lol. I also feed it information from the official docs when it gives me bollocks, I assume others probably do the same so maybe, its just a theory :)
AI is moving fast so ill probably look back at this post in 2 years and laugh, but that's the current state in my opinion.