To be honest, I think a lot of our generation thought that. Inflation rocketing way above average wage increases has put a stop to that. Let alone cost of living crisis currently, as well as COVID impacting the situation too.
Be careful with flats - it's great to have your own independence in it but it comes with its risks (not all, there are some advantages). Some management companies for flats charge a lot for a Service Charge, so make sure you look into exactly what you pay them for and what you get in return - I think you can look in to historic Year End statements for each company. There's also the risk of what kind of neighbours you'll have - privately owned and used, sub-let/tenanted, social housing etc. Make sure the lease is over 75 years as well. Otherwise it becomes hard to sell; most buyers look for at least 99 years on a lease. Renewing the lease is extremely expensive...
If you can afford a house, go for it. It's by far the better option for security and ownership and responsibility for alterations or amendments to the property you own. With a flat, you own the property, but not the land per se. So you become restricted on what you can/cannot do as per the covenant/lease.