The sitcom about failure is an ignored, ignoble American tradition. The Brits are far better at it, at celebrating not just the parts of themselves that are off-putting but those that actively court and occasionally find disaster. But we Americans are a plucky lot. We want to see shows about people who will eventually become winners. Maybe they won’t win right now, but someday, they’ll find glory. If Sam and Diane are going to be stuck together in purgatory, they might as well have a love for the ages, and if an engagement ends disastrously for Mary Richards, she had better find out she’s going to make it after all.

But shows about people who keep losing and almost never win are rare, and they tend to be rejected by the viewing public. Taxi hung on for five seasons, but only because it was on after Three’s Company for the first two; even being on Starz and thus enjoying the benefit of lowered ratings expectations couldn’t save Party Down. The John Larroquette Show was so depressing that even a retooling couldn’t pull it back from the pitch black, and no less a sitcom impresario than Chuck Lorre is struggling to attract viewers to Mom, a series about the downest-and-out of the down-and-out: recovering addicts struggling to put their lives together. (Even there, they live in much-too-large apartments, as if to assure viewers that this isn’t really happening.) No, we don’t like our comedies to be about failures. If the characters are going to be stuck at Cheers or mired in the Conner kitchen or trapped working at Dunder Mifflin, then they had better be happy to be there, damn it.

There’s an exception to this rule, however, and it’s a show that ended a long, astonishingly popular (particularly when you consider just how close it came to being canceled several times) run on CBS last night. Yes, the popular reading on How I Met Your Mother is that it was a show about hope. It’s all contained there in that title, after all. The future will be better, because that’s the place our hero’s beloved resides, and so long as he can get to her soon enough, then whatever happens along the way is an important part of his journey toward becoming the man who will win her love. But the hope of the title is there only to leaven the failures present in the text of the show itself. HIMYM is a series about a group of five people who don’t really attain the goals they set out for themselves in the first season. It’s a show about people who learn to be OK with compromise — at least a little bit — and come to realize that not getting what you want can sometimes be a wonderful thing. It’s filled with bittersweet melancholy at its best and its worst, and when it was at the top of its game (as it was for most of its first four seasons), it could be formidable in depicting the way life has a tendency of stomping all over dreams.

Of course, it’s also this impulse that ultimately got the show into such trouble in its series finale, which is the sort of big swing that TV series only take when they’re trying to create something epic and remarkable. This is commendable, to be sure. The straight-down-the-middle series finale is a sitcom staple — we just had a peerless example in 30 Rock’s finale last year — but it largely follows a template set out by The Mary Tyler Moore Show and doesn’t seek to rock the boat. It leaves the characters at a point of happy stasis, that we might imagine them group-hugging or hanging out for one last beer in perpetuity. The worst that can happen with this kind of finale is a forgettable mediocrity — have you thought about The Office’s finale lately? — which is rarely enough to besmirch a show’s legacy.

How I Met Your Mother aimed for something bigger than that, something more in line with the finales of M*A*S*H and Roseanne (both of which were also wildly divisive, for what it’s worth). Leaving the characters in a place of happy stasis wouldn’t have been in keeping with the show’s spirit. Yet at the crucial moment HIMYM could have truly left its mark, it choked and tried to split the difference. But to understand why that may have happened, we have to dig into the show’s history of failures (both fictional and actual).

♦♦♦

None of this should have come as a surprise. It was all there in the show’s pilot, which set up the standard romantic-comedy meet-cute (between protagonist Ted Mosby [Josh Radnor] and new-in-town Robin Scherbatsky [Cobie Smulders]), and then undercut it at the end by revealing that the woman in the show’s title was not Robin, who didn’t want to have kids and wasn’t particularly built for the kind of cozy monogamy Ted so longed for. (For years, the show’s highest-rated episode was the pilot, and it was easy to imagine all those viewers who don’t like shows about characters not getting what they want tuning out with a hearty “Nope!” after the pilot’s final reveal.) The problem with this was that creating a series that endlessly circled questions of not getting what you want eventually became the whole reason the show grew stale and eventually hard to take.

By far the most common suggestion made by armchair showrunners in terms of how to “fix” HIMYM had always been to introduce the Mother earlier in the show’s run (perhaps around the end of Season 5, when the show had run through every possible combination and iteration of its core cast). And when Cristin Milioti turned up in the eighth-season finale and much of the final season as Tracy McConnell, the woman Ted would eventually marry, it seemed those nitpickers were correct. Milioti was so terrific and used so sparingly that crying for more of her became a weekly tradition on social media and in comments sections. Yet to have too much of her would have both fatally imbalanced the finale’s emotional weight (more about that in a bit) and defeated the series’ embrace of its characters’ failures. If Ted meets Tracy at the end of Season 5, then has two or three happy seasons with her — even if the show ultimately kills her off, as it ended up doing — then it’s no longer about an inexpressible longing for something that always slips just out of one’s grasp. It’s about how people eventually get what they want, and that’s counter to the series’ spirit.

Look at the dreams and goals of the characters as set out in the first few episodes of HIMYM: Ted wants to get together with Robin and have kids. Robin wants to have a massively successful career in journalism. Barney (the incomparable Neil Patrick Harris) wants to bang as many chicks as he can without getting attached. Marshall (secret weapon Jason Segel) wants to become an environmental lawyer and save the earth. His eventual wife, Lily (Alyson Hannigan), wants to become an artist. Then the series — those first four seasons in particular — takes its time picking apart and destroying these dreams, or just depicting the way that, as you get older, the things you really wanted at 27 start to feel like things you were never meant to attain anyway.

To be fair, HIMYM was never as cruel to its characters as, say, the British Office could be. But not one of those goals was achieved over the run of the show. Ted dated Robin for a time before they realized they were simply too different and broke up. Robin had an endless string of jobs she thought would be exactly what she wanted, only to end up being stuck behind anchor desks or forced to do humiliating, fluffy feature assignments not worthy of whatever talent she possessed. (The series offered up some surprisingly strong feminist story lines when it wanted to with Robin, until it completely lost sight of her in its final seasons and turned her into exactly the opposite of what it had wanted her to be initially.) Barney comes to realize the emptiness of his sexual conquests and begins to fall for Robin, to say nothing of how his origin story is all about how his initial dream of helping Central American orphans was stomped all over by a douche bag businessman. Marshall gives up on his dream and takes a corporate job he actively believes is making the world a worse place. Lily’s art is of real interest only to dogs, and she resigns herself to being a kindergarten teacher for life. The naked hunger to achieve her dream, and fear that she might not, actually disrupted her relationship with Marshall, which was typically the show’s one stable element. Failure is real. It destabilizes. It creates wounds.

Within the final few seasons, the show ended up giving its characters versions of the dreams they’d longed for, but they were almost always diminished forms of what they had wanted in the first place. Robin eventually becomes a globe-trotting journalist, but it’s after years of disappointment, and the job tears her away from her friends. Similarly, Marshall eventually has some beneficial impact on environmental law, but as a judge, not a lawyer. Lily’s art career ends up consisting of being a curator for some other person in Italy, instead of creating her own things. Ted keeps throwing himself headlong into winning Robin’s heart, only to find he can’t compete with Barney, or his own lunkheadedness, or the universe in general. Throw Tracy into this milieu, and the series stops being about broken dreams and compromises, and it starts to become just another warm and fuzzy romantic comedy. (It’s also worth pointing out that even though the characters experienced occasional financial struggles, the series was never particularly interested in class or economic issues. Everybody lived in great apartments, and their money problems were either dropped or solved in unbelievable ways. And so it goes with sitcoms about young people living in New York.)

Just about any series that runs long enough will see the things that make it strong eventually become its biggest weaknesses. The same was true for HIMYM, in which the inability to let the characters truly move past their dreams or actually achieve them eventually just got tiring. This was notable primarily in Ted’s endless pursuit of Robin (and her bizarre and sudden fixation with him over the course of her wedding weekend), but it was already evident in Season 5 with Barney. He dated Robin, then broke up with her, then abruptly reverted to his earlier self as if nothing had happened, then fell in love with a few other women, then reverted to his former self, and on and on. The show was so hesitant to have him grow and change that it pulled a variation of this same arc in the series finale, an episode after he had theoretically completed his story by finally being emotionally vulnerable in front of the woman he loved more than anything. The embrace of failure and compromise — the very thing that made How I Met Your Mother so vibrant in its early days — became that which trapped it on far too many occasions.

Yet it was also the thing that made the series finale at once so impressive and so disappointing. The Shakespearean comedy almost always ends with a wedding, and HIMYM could have ended with three of them. Marshall and Lily renewed their vows for an audience of each other in the next-to-last episode, right before Barney and Robin got married, while Ted and Tracy’s wedding day was depicted in the series finale. And yet the only cliché almost as big as a happy ending is that happy endings don’t exist in real life. Barney and Robin were always going to see strife as a couple, and the combination of his nature and her job caused their marriage to dissolve after three years. Ted and Tracy got to be happy together for 11 years and two kids, but she contracted an unspecified illness and died. Marshall and Lily mostly escaped unscathed, but all the while watching their friends’ lives pull their little group further and further apart. Other sitcom finales have introduced outside elements designed to pull apart the ensemble forever; HIMYM suggested that aging and time — to say nothing of disease and divorce and despair — make such things inevitable.

“Last Forever” comes so close to managing something genuinely moving and maybe even profound that it makes its ultimate inability to stick the landing all the more disappointing. It’s as if the series caught a whiff of its own embrace of failure and decided to find a way to abruptly veer away from what might have been an all-time classic finale at the last possible second. See, Ted’s story to his kids that framed the whole series hasn’t been a way to help them get to know his younger self, or even to understand how he became the person worthy of loving their deceased mother; it’s been a long story about how he’s secretly in love with Robin, something he may realize on some self-justifying level and something his kids definitely do. (The scene — filmed early in Season 2, revealing this was always the plan — in which his kids tell him to go after Robin immediately after he gets done recounting the story of his wife’s death is one of the most tonally inappropriate things ever seen in a sitcom of this caliber. It’s like a clown hitting a corpse in the face with a pie.) Never mind that the show got us incredibly invested in Tracy, or that it spent two entire seasons trying to convince viewers that Barney and Robin were a viable couple. The initial plan must never change.

So Ted heads out to make one last grand, romantic gesture for Robin, and all ambivalence goes out the window. She smiles. He smiles. Show’s over. There may have been a way to make this work — a suggestion, say, that Ted was just in the neighborhood or a reminder that Tracy had told him to move on with his life after her death — but combined with the awful framing device, it felt like the show going cheap, embracing happy stasis immediately after an episode that told us how impossible such a thing was.

The reason comedies rarely go for the big, ambitious ending, when it’s considered a matter of course in dramas, is largely because we like happy stasis. We like to believe that Roseanne and Dan Conner are still squabbling away, not that he’s dead, or that Hawkeye and B.J. are still cracking wise and examining the horrors of war together, not that they likely never saw each other again, no matter what history says. And some viewers somewhere must have been hoping Ted and Robin would finally get back together, despite the series they starred in devoting one of its most elegiac episodes (the final season’s 17th entry, “Sunrise”) to the idea that they never could. We want to believe our fictional friends stay frozen, that we can always count on them when the series premiere rolls around again in syndication’s ouroboros.

But HIMYM was supposed to be different. It was supposed to understand that the thing that made it once great and then frustrating could redeem it in the end, and it blinked at the last possible moment. Behind the door marked “life doesn’t always have happy endings” was just another happy ending. This one was meant to make us ecstatic but ultimately only called attention to the fact that at the end of the show, HIMYM may have been many things, but it was rarely brave.

Todd VanDerWerff (@tvoti) is the TV editor of the A.V. Club. His writing also appears in the Los Angeles Times and Salon.