Despite being profoundly controversial, Ted and Robin getting back together in the How I Met Your Mother ending was heavily hinted at offhandedly in a season 3 filler episode. Back when the How I Met Your Mother series finale first aired in March 2014, many complained because of the sad twist of the titular mother’s death, but also because the sitcom unexpectedly revived Ted and Robin as a romantic couple. However, while both twists might have felt as shocking as they could be perceived as unforeseen, Ted and Robin were hinted at multiple times as Ted’s endgame by How I Met Your Mother, even if Tracey was who Ted married.
https://screenrant.com/how-i-met-your-mother-ted-robin-ending-blahblah-reveal/