That's completely wrong. The money put up by PE firms is more at risk than any loan received by a bank. Bain Capital, for instance, lost money on the Toys R Us buyout. The bank would not agree to loan money for a buyout without an explicit covenant that would prevent such shenanigans. The generated cash flow is used to pay down debt; the PE firm usually only makes a profit when it exits its investment.
Banks agree to loan to PE firms because buyouts usually work and PE firms are right when they believe they can increase margins. The extra debt load reduces the tax burden and makes the debt easier to pay off.
The PE firms put up around $1.3B for Toys R Us with a $6.6B total leveraged buyout. The received around $200mm in consulting and other fees during their tenure. They also received interest payments for their portion of the capital. And there were several other deals and consolidations that are estimated to have netted the P/E firms several hundred million more. But these deals are far to complex to get exact numbers. It's likely that the PE firms lost big on deals like toys-r-us, but they definitely skim off the top all along the way thus making their final losses less. https://www.theatlantic.com/magazine/archive/2018/07/toys-r-...
https://www.nytimes.com/2017/08/11/business/the-incredible-s...
None of that can be easily undone by a bankruptcy court.