They switched equity for debt. This is normal when taking private a publicly traded business. Both the lender and the borrower know what they are doing better than outside commenters who have never spent any time studying "going private" financing.
It's pretty clear the borrower didn't know what they're doing when they made this deal. The borrower even tried to get the deal canceled (or maybe just renegotiate) by going through the court, and failed.
The lenders moved forward because they know the borrower is good for it. And the borrower can afford to lose even more billions and still function. The borrower can afford to make mistakes of this size.
I think you're confusing "this has been allowed to continue" with "all parties know what they're doing".
Mergers where the loading of debt onto the company to finance the merger is a major cause of bankruptcy also aren’t that unusual. (For both public firms and firms taken private.)