There must have been several endings shot, right? They couldn't possibly know they could make this ending happen back in season 2, when the kid scenes were filmed.
Arguably that's why there's a lot of backlash. In fairness all the kids said that Mom had been dead for six years and that he was in love with Aunt Robin. It didn't really say anything about the story... in fact it probably works out better if it was done at the end of Season 2 or so.
When you go back and look at Season 1 and 2, the show looks like it could easily go in the Robin direction. It's just about how Ted wants to settle down. The mother isn't especially established as a one true love for Ted, just someone who is the mother of his children.
However the show is entirely different now that it was then. I actually see a shift beginning in Season Three, but doesn't fully develop until the fourth season. When you look at the show at the start, it's about Ted looking to settle down and get married. We know he gets married to the kid's mother in the future, but we know next to nothing about her. There's really no reason to believe that she's his soulmate or one true love. The only references to "I never would have met your mother if such and such didn't happen" could easily be interpreted as for the sake of his children. That's why this ending works there. Because as of now, Robin is seen as that one true love for Ted.
However, once "No Tomorrow" happens they introduce the idea of destiny to the fold where they begin trading the Yellow Umbrella. Still he's getting over Robin at the time, so there's still time to have this work as an ending, but once the end of Season Four comes around, it just doesn't anymore. The last few episodes of Season Four ("The Three Days Rule" "Right Place, Right Time" "As Fast as She Can" and "The Leap") all paint the Mother as Ted's soulmate. And that is the story the run with for the rest of the series. Especially in Double Date and Girls Vs. Suits.
And congruently to that, they make Robin less and less of Ted's soulmate. There are too many false starts and times where they give it a try and it just never works. That's why we say the series outgrew the ending and what the writers wanted no longer fit the narrative demands. I fully admit that there was a time where I wanted Ted and Robin together, but nine years later, that's no longer where the show was.
And don't give me anything about how we're not supposed to see that Ted and Robin are meant to be together and how it's just an example of Ted finally being open to other possibilities after the death of the love of his life. The swell of the music (hell read the lyrics) and the Blue French Horn show that ultimately the story was about how Ted and Robin are destined to be together. That's why it doesn't sit well with me. That may have been the story that they were telling early on, but I was in High School when the show started and now I'm two years out of college. A lot can change in that time and this show was one of those things.