Even if you are lucky to use a language where the official documentation is very good, there’s still a chance that you run into some issue that isn’t covered by it or is out of scope. My personal example is an issue installing a third-party Python library on a certain macOS version. I wouldn’t expect this to be in the official docs considering it’s a bug in the OS (more specifically where the unofficial package manager puts C libraries), but it’s still an issue that’s preventing me from getting stuff done.
StackOverflow had an unanswered question about it, and similar questions (with answers) for other libraries. With those answers I was able to solve my problem and post an answer to that original library. It’s still earning upvotes 2 years later suggesting it’s being useful to quite a few people.
There’s also the issue where you have to work with languages where documentation isn’t ideal or the behaviour is implementation-dependent (JavaScript and CSS come to mind). In a perfect world we would have one authoritative source for docs and all implementations would follow it. We’re not in a perfect world, so the next best thing is a site where new people can ask questions and people experienced with the issue at hand can share their knowledge.