SO's extreme hostility definitely drove people to the first viable alternative (AI) as quickly as possible, so it might have survived longer if it hadn't been so hostile.
But to be honest I expect that would have just delayed its death. AI is so good now I think I'd use it even if Stackoverflow was really friendly.
I am curious why questions about AI itself haven't had a bigger impact in slowing this all down a little. AI is a whole new field for programming and there should be plenty of interesting questions surrounding AI that are worth discussing on SO.
My attempts at discussing AI related questions with AI itself have been pretty frustrating, especially in the early years, since they are either just uninformed about what's currently going on in the AI space or recite random blog posts of questionable value, often they couldn't even tell what they themselves are capable of.