the thing with 2008 isn't that 20% defaulted. it's that the banks built an insurance pyramid scheme to borrow more money and one bank was left holding the bad debt.
Bank A , B , C and D each have 100 loans of which 95% are good and 5% are bad. Each bank is maxed out on loans they can legally, and fiscally move. to make more money they need to insure the loans.
So Bank A and Bank B take 50 loans each 45 good one and the 5 bad ones and get insurance from bank C. This gives Bank A and B the ability to take on 20 more loans each with at least 2 of them being bad.
Bank C goes to Bank D for insurance and gives Bank D their 5 bad loans as well as the 10 bad loans from Banks A and B. this gives Bank C ability to also take on 20 more loans.
Bank D is now holding 190 loans including 20 bad ones and their risk went up from 5% to 10%.
Wash rinse repeat. they did this until one bank had 20% plus bad loans in their portfolio. when it collapsed all the cross insurance collapsed as well. That is why 75% of the government bailout loans were repayable in 4 months. The banks just needed to cover short term costs with the pyramid to each other.
Quite an over simplification, but it also assumes that the banks knew in advance which loans where bad - which they didn't.
One of the big pit falls for the home loans was that there were (a) a lot of loans that were themselves loans for other loans (Jumbo Mortgages, Subprime lending), and (b) there were a lot of loans with variable interest rates which were then defaulted on when the Federal Reserve attempted to raise the Interest Rates; inevitably there was quite a few of 'a' in 'b', and the various risk calculators that were used by the 'C' and 'D' banks in your example didn't know how to account for that kind of thing in the risk assessment, in part because it was unaware of some of the necessary parts of the risk and unable to control others.
Keep in mind that the mortgage grouping and selling that was part of the issue was a known thing. You bought a $1M USD note containing 10 mortgages knowing that 2 would default but it would be made up from and exceeded by the interest paid on the other 8. What was not accounted for was the issue of variable rate interest loans so when the interest rates when up a greater than expected number of loans defaulted, wiping out the ability to cover the $1M note.
Now there were several dozen different factors that caused the issues in 2008. However, a lot of the home mortgage issues were solved by (a) stopping the robo-signing practices that approved a lot of bad loans, (b) converting variable interest loans to fixed interest loans, and (c) actually trying to work with borrowers to solve the problems (typically variable interest loans). There was also quite a sizeable chunk of loans that were just completely written off - no sold, not insurance repaid, not government repaid; but actually taken off the books and discarded as a loss.
The money borrowed from the government, however, more or less was a temporary hold-over to stabilize the books and came with severe restrictions - which is really why it got repaid quickly as the banks didn't like the restrictions so they made every effort to repay it and get out from those restrictions instead of making the effort to restore a working economy as was intended by Congress.