There are two kinds of risk that are fundamentally unavoidable in being a "bank" - that is, any institution that borrows short and lends long. One is liquidity as a result of that duration mismatch: you have enough money owed to you that you've lent out, but it's not due yet. The other is loan writeoffs: you've lent money that you cannot get back, often because it's secured against an asset whose value has fallen significantly.
These can be reduced but not entirely eliminated by setting reserve requirements, LTV ratios, etc., which is what https://www.bis.org/bcbs/basel3.htm is all about.
You can't really eliminate the duration mismatch without eliminating anything recognisable as a "bank", and it becomes much more expensive to get credit and to do basic financial operations.