It can still be cheaper to rent, at least if you look at the small scale. Because in 30 years, those 4 million will be yours while people who rent will still have nothing. It’s also risky, because maybe those 4 million will really be 1 million.
Over all, owning real estate in a safe location is always going to be much better than renting. At least in Denmark. Hell, if you can manage to buy around 15-30 lower-cost apartments in a university city and rent them out, you’ll be able to pay your loans and have enough spare in passive income that you never have to work again.