Here’s my math:
$12 trillion in mortgages
5% in trouble = $600 billion
95% are performing and banks are making, say, 5.25% PER YEAR in interest on the outstanding principal = $598.5 billion in interest revenue made EACH YEAR by the lenders.
Difference = $1.5 billion
They leant the money. They charge interest to cover their risk. The interest made in one year completely covers their losses if the 5% of bad mortgages are utter losses.
You are not including the decline in the value of the collateral asset (i.e., the house).
Mortgage lending at 5.25% APR is a loosing proposition if housing prices are declining by 10% a year.