People who can afford 400k mortgages expect to earn, over their lifetime, more than 400k. They just haven't earned it /yet/. The willingness of people to pay them over 400k for a lifetime of labor is what makes houses worth that much, not the willingness of banks to lend them that money today.
Actually, when I hire people I don't recommend them mortgaging their life, regardless of what I might think about affording or not to pay for their services either now or in an immediate future. In a surrounding changing world, instead of gaining leverage to better cope with its changing nature, people instead take mortgages! And guess what - they don't do it in their most clear minds. They always do this life-changing decision dreaming. That is what makes things overpriced and unaffordable without a mortgage.