once the company goes bankrupt there might be no one left to open source the leftovers if that's even legally possible due to NDAs, 3rd party licenses, etc.
Then it should be anticipated. Just like a company is required to pay employees what it owes them before it eventual shutdown, even in case of bankruptcy.