You merely need capital. Lots of buybacks are funded by debt
BTW, this is exactly what private equity companies do when they take a company private. They borrow a lot of money to buy the outstanding stock. Often the company they are buying with debt (held by the company) is not profitable. And sometimes the company goes bankrupt.
So yes this happens.
https://fortune.com/2019/08/20/stock-buybacks-debt-financed/
https://www.cnbc.com/2019/07/29/buybacks-companies-increasin...
https://crsreports.congress.gov/product/pdf/IF/IF11393
From the last one: "Data on the percentage of buybacks that are leveraged are inconsistent. For example, the bank J.P. Morgan Chase reported that leveraged buybacks accounted for 14% of overall buybacks during 2018, which it said was the lowest percentage since 2009. But Yardeni Research, a respected securities market research firm, reported that they were 56% of the total."
Or recently, government support packages.
If I don't need the money, I can just let it continue to grow tax free.
[1] unless the holder has elected for trader tax treatment, in which case shares are marked to market at the end of the tax year
This is the shitty side of many modern CEOs. But the legal and tax incentives combined with Wall Street demands create the environment for it.