I've tried it with both, and it makes the same error. Copilot doesn't even get close. This is just one example of many. Beyond a certain degree of complexity, for problems that aren't documented in some tutorial or answer somewhere in its training dataset, ChatGPT is not going to be able to help you. I've run up hard against its limits many of times, and I feel like most of the examples people provide are actually a lot simpler than they believe them to be.