It could have very well been wrong; perhaps it could have carried this out some other way that I was unfamiliar with. But in this case, ChatGPT wins. This is why if you blindly copy/paste responses, you'll inevitably be wrong too many times and lose credibility.