Banks do have strict risk requirements (i.e. Basel III), in terms of what they are allowed to do with money, and are stress-tested on a regular basis. However, the type of scenario OP is posing would mean every bank would need to write-off their loans, and hope they have capital invested in other places to keep them afloat.
Since banks have these capital at risk requirements, the government feels comfortable to guarantee accounts up to a certain amount, as every bank going down at the same time is generally speaking a very unlikely event. So usually they would cover the account, take over the bank (if needed), put it into administration, and wind-down positions to claw back money to cover the insurance claims.
Banks do have strict risk requirements (i.e. Basel III), in terms of what they are allowed to do with money, and are stress-tested on a regular basis. However, the type of scenario OP is posing would mean every bank would need to write-off their loans, and hope they have capital invested in other places to keep them afloat.
Since banks have these capital at risk requirements, the government feels comfortable to guarantee accounts up to a certain amount, as every bank going down at the same time is generally speaking a very unlikely event. So usually they would cover the account, take over the bank (if needed), put it into administration, and wind-down positions to claw back money to cover the insurance claims.