Banks fail sometimes and there is no regulation or risk management system that can prevent it.
To increase protection for clients and economy one could by law introduce 'bank types' where, for example the type 'low risk' is only allowed to do transactions with low risk with of course lots of options to define what 'low risk' is.