Consider a bank that offers 2% interest on certificates of deposit. The bank sells ten of these at $1,000 each. It lists this $10,000 (plus interest) total under Accounts Payable. The bank then goes out and issues a $10,000 loan to someone charging 6.8% interest. The bank now shows $10,000 (plus a higher interest) total under Accounts Receivable.
We now have a bank with roughly $10K under accounts payable and $10K under accounts receivable. If the bank 'forgives' the $10K under accounts receivable, where does it get the money to cover accounts payable?
The bank in that circumstance would not be permitted under its regulatory authority to cancel that loan. Very simple.
Now, make it a little bit more realistic: the bank makes a $10,000 loan that the borrower subsequently defaults on, and the loan is discharged in bankruptcy.
The bank itself now enters receivership because it does not have sufficient assets to cover its liabilities. If the CDs were covered by insurance, that would cover the repayment of the CDs; otherwise, the bank shareholders may be required to contribute additional capital to cover the shortfall. Finally, if all else fails, the CD holders have a loss as well.
That is why, in part, banks are required to maintain certain minimum capital requirements.
Bad analogies made for bad comparisons.
And yes, that is how accounting works.