Most companies always have another idea to do a new thing, that might induce growth. WW did not. WW has been in trouble for decades, because their business model pre-supposes consumers are too stupid to use a search engine. (Does "weight watchers" work? No. No it doesn't.)
The debt-for-buyback swap is a symptom, not a cause. Management had nowhere to go, no vision for growth, and when you are out of ideas and you are offered an attractive loan, you do a buyback.