Good answers below, especially from Reginald.
People's plans change all the time. They decide they want to live somewhere else. Or one of the folks dies. Or one becomes ill and they want/need to move closer to relatives. Or maybe the neighborhood changes. A neighborhood that looks great now may not be so great in 15-25 years. Or the rental property itself may be pretty nice now, but kind of dated in 25 years. Or maybe you want everything on a single level, but you've bought a multi-story property.
So: Buy a rental property strictly as a rental property. OK, it can be in the area you'd like to move to when you retire. And maybe it can be the same sort of configuration (townhouse, single-family home, etc.). But make sure that it works, today, as a rental. Then, in 15-25 years (or whatever the time span is), if you still want to move there and everything else still is OK, then do so and enjoy. But base your decisions today on it being a rental and only a rental.
Hope that helps.