We don't know that Ted ended up with Robin. He's tried the same thing before. Who knows if in 5, 10, 15 years from the last scene if they'd still be together? Robin isn't exactly the most stable person in terms of relationships. Just because Ted shows up with a romantic gesture after realizing he's still in love with her, it doesn't mean she will reciprocate. It's the same as the premiere, really.