But those aren't the only costs. When you rent you are generally shielded from paying for various things, like fixing damage to the apartment or other serious maintenance. Also, renting saves you from the risk of the house losing value because of some local event like a neighborhood becoming less attractive due to a new source of noise or crime. Finally, these estimates assume home prices will rise according to "historical norms", which is a gamble.
Renting also lets you move around to pursue another job in another city, without needing to worry yourself with renting out your current location. The worry might deter you from moving and getting a higher salary, or it might make you spend the time, effort and risk to rent out the place you own, which brings its own costs.
It's hard to quantify those things. Some are unlikely events, some affect the variance instead of the mean, and some depend on the individual (how likely you are to find a job in another city - probably fairly high for people reading HN compared to other industries). But I never see them taken into account in articles like this.