The bank MUST sell your debt to someone else. It must because it is obliged to sell off its assets (your note) to satisfy its creditors.
The bank is not free to just leave your debt lying around in its inventory, going "la la la, I think I'll just leave these debts sit here unattended". The landlord, the county tax assessor, OfficeMax, the Acme Safe Company, etc. etc. are banging on their door going "Pay me!"
Once it's in bankruptcy, this is even more certain, since bankruptcy is essentially court oversight of the sell-off. So they MUST provide complete records and satisfactory answers to the court, and the creditors are watching like a hawk.
There is no way a file drawer full of mortgages are going to get "forgotten about". Let alone a computer full.
As R. Hamilton notes, a few got lucky in the mortgage bust in the 2010s, but that was more about punishing creditors for being careless and lying. That's not something you can take... to the bank...