If you have identified the place for sure where you are going to stay post retirement please buy it in early stages of your career. Advantages EMIs are over prior to Retirement, full tax benefit, likely rental income and satisfaction of ownership. Disadvantage is the property would have become old and lost its charm.
However If you are not sure where you intend settling down then don't guess and defer your house purchase . Advantage being first owner of your brand new house. Disadvantage being a sizeable corpus needs to be earmarked and planned for this big ticket purchase.
Buying a house purely from a financial perspective is avoided since financial pundits will always tell you why renting makes more sense. But lot many decisions which get you happiness in life are not always taken from your mind but your heart.
Alternate View
Buy a house early in the career in a good city and prefer a metro. It will give you good rentals and the property will also appreciate.
When you retire either settle down in the same property or sell it off to buy a property where you wish to settle down.
Just to add to the housing Saga
1. Buy only what you require and not what you can always afford I have seen enough FSH pattern houses rotting away because the only two occupants ( husband+wife) failed to realise that children will not stay just because they built exclusive rooms for them. Now the chowkidaar and his wife are enjoying the comforts while the aged couple are shuttling six months between their children ( India or abroad)
2. Prefer a good gated community with security to avoid botheration of independent house which ends up being a pure liability for many.
3. Buy property with good connectivity and where basic amenities like maids, good hospital, emergency care, shops etc are readily available . The concept of self contained townships works pretty well
4. Wilderness, snow capped, nestled amidst hills are USP for selling only... unless you enjoy a secluded life with minimalistic comforts don't make post retirement life equally challenging.
5. Also explore options for senior living which are exclusive society curated for them.
6. With the fast paced life be prepared to bank only on yourself even in emergency.