And, just to respond this specifically, I would say, yes. Very much yes. D&D absolutely pulls towards the "happy ending".
1. The level system. Your character gets more and more powerful. Like, a LOT more powerful. Capable of altering reality. What kind of tragedy is there that a high level caster can't just "do over" without a lot of nerfing the spell system? I played a recent campaign where one of the PC's father was killed. Poof, one raise dead later and no more tragedy.
2. The reward system. Again, the characters are expected to gain magic items and whatnot of greater and greater power and efficacy. How tragic can your life be if you have a Ring of Wishes? A bunch of magic gewgaws that mean you can not only not fail saving throws, but, often can redo failed actions. So on and so forth.
3. Any of the systems around organizations or bastions. As your character levels up, his standing in his organization rises, and the character gains access to more and more options that make any sort of "tragedy" rather hard to stand. If my cleric is 10th level, not only can I probably petition my divine organization to do stuff, I can outright petition my deity to directly step in.
That's off the top of my head. I'm sure there's more. And, once you start getting into specific classes and whatnot, the list of "get out of jail free" type mechanics just gets longer and longer. Rerolls, Action Points, Luck points, spells, magic items, other NPC's. The list of things that D&D has that pull the party towards the "happy ending" is very, very long.