See another take I disagree with is that the main cast had to die for the story to be interesting or impactful. Personally I wouldn't have enjoyed any of the deaths in that spoiler tag at all, and losing those characters in those ways more than likely would have tanked my own enjoyment of the story.
Death isn't the be all end all negative consequence and I don't think it's at all necessary to tell a good story. I mean don't get me wrong, I don't think Endwalker was spectacular or anything, but I still enjoyed it for what it was. But then I also don't mind a cheesy cliche if it's entertaining, and for me the UT story was.