A surprise engagement caused Ted and Robin to break up in How I Met Your Mother season 2, but the moment between the two extras was real. Proposals were a frequent occurrence in the series, and they were often taken to an entirely different level than a typical engagement (like Barney's multiple-step plan). Of course, in HIMYM season 2, Ted and Robin were far from ready to commit to one another, but the same wasn't true for the real-life actors that served as extras in this particular episode.
https://screenrant.com/how-met-mother-season-2-engagement-proposal-real/