According to Wikipedia, one of the reasons for using a shell company is that "Shell companies can be used to transfer assets from one company into a new one, while leaving the liabilities in the former company." My understanding, from a response to an earlier question, is that this much is legal.
But suppose the assets have been pledged as collateral for liabilities, and there are contracts governing this process. If shell companies are used to "shuffle assets" between, say companies A, B, and C, so that the assets and liabilities are separated, is this still legal? Or can these transactions be "collapsed" so that one combined company has ownership of both assets and liabilities and the contracts that govern them?