"ChatGPT" can mean many things... If you meant the free 4o-mini model, then yes, this outcome is not surprising, since it is bad at basically anything related to code.
If you meant the more powerful o1 or o3-mini models (great naming, openai...), then that outcome would be surprising.
If you meant the more powerful o1 or o3-mini models (great naming, openai...), then that outcome would be surprising.