OK, a couple of things here on the general topic of characters death.
I think character death is fine - I enjoy it in my Call of Cthulhu games, for example. However, no character death is also fine -- and contrary to what LiferGamer suggests, it doesn't mean that the action is all scripted or that there is no failure. I've played a fair bit of Champions, for example, which usually had no PC death. It was just a given of the genre. PCs can still fail - in which case the villain gets away with their loot, or innocents get hurt or killed, or catastrophes happen. Maybe authorities and allies lose faith in the PCs, and abandon them.
If the only possible way to fail is to die, then I think that implies an extremely narrow view of adventures.
'Random' deaths also add some verisimilitude. Shit happens, people die doing and for stupid reasons. Richard the Lionhearted didn't die in battle, he died from an infection. No glory. Just death. Death isn't meaningful, it just happens. Make LIFE meaningful. I've gotten more mileage out of a group coming together over the death of a companion than any Harry-Potter-plot-armor-chosen-one-bullshit.
DMs - is your story SO IMPORTANT that you remove player agency? Most of you are shouting NO! OF COURSE NOT! But if you're throwing softballs, you're basically guaranteeing victory, and rewarding failure. Your PCs are just going to fail upwards.
Random character death flies in the face of a game where the players are playing heroic protagonists. It's against the spirit of the game for protagonists to die meaninglessly.
Heroic sacrifice is absolutely within the themes of the game. A character going out in a blaze of glory. Or offering themselves up to save the rest of the group? Absolutely within the perview of the genre and good play. Such is definitely the sort of in-genre thing a player should be congratulated for and look forward to doing. Because they make the game memorable. It an act supportive of good story.
Random character death I balieve is a holdover from the wargaming days of the hobby. Where characters were treated as playing pieces and viewed as expendable as an extra life in classic video games. It's something that came from a forerunner of the medium, but never truly suited it.
I think in principle a death can be both random and meaningful. A PC dying in deadly combat with monsters is not the same as Richard the Lion-hearted dying of an infection. They died fighting an enemy - which calls for mourning and possibly revenge, and so forth. In real life, when someone dies in war, people often ascribe great meaning to it - even though the death was presumably random.
That said, I do think there's a tendency in many campaigns for PC death to be not very meaningful. In part, by the nature of the role-playing, the player most involved has now been thrown out of character. Often, the other players' reactions are something like "Sorry, that sucks, Barb" or "Well, you should have been more careful, Joe." The player of that character is still there at the table, so it's natural to talk to that player out of character.
I do think that the character deaths that have been the most meaningful have been planned in some way - either in-game (as the PC choosing to sacrifice themselves) or out-of-game. But there is a spectrum, and some random death does have meaning.