It’s not a loophole. It’s people lending money to people who can’t pay it back. That’s capitalism. You make a mistake and lose money. It’s the exact same kind of mistake as lending to a wannabe restaurateur whose restaurant fails. You lent money to someone who couldn’t abide by the terms of the loan. As the lender that is your problem.
Sorry if I am being obtuse but I don't think that Toys R Us lent the PE firm money to buy Toys R Us. But somehow Toys R Us was responsible for paying back the debt that the PE firm took on to buy Toys R Us.
The PE firm should have more skin in the game, if they take out a loan to buy Toys R Us, they should be responsible if the company fails.