ChatGPT is like a smart human inventing a hypothetical API which would solve your problem. A service like StackOverflow has people who are actually familiar with what actually exists in reality. The human will usually know enough to come up with some alternative approach or workaround where ChatGPT hallucinates an answer.
I have seen nothing to suggest that future modes will fix the hallucination problem. I wouldn't be surprised if it's just an inherent, unfixable issue with the concept of neural network language models – they don't have a model of the world from which they produce logically coherent text, they simply have a giant statistical model for which words tend to occur in which order – so I don't see why we should expect a language model to not hallucinate. But I'm not an expert on the current state of the art, so if you have some links to papers which indicate that the language model hallucination problem is solvable, I'm open to admitting I may be wrong.