That is why stock buy-backs only make sense if the shares are priced too low.
(That said, I do understand companies usually overpay for their own stock, so the move is not necessarily the best one for any given company or companies in general unless the stock is, in fact, undervalued. But it is still one way to deliver returns into the pockets of shareholders, anyway.)
If a company buys back stock that is overpriced, it actually destroys shareholder value. If the stock is priced correctly the outcome will be neutral for the shareholders. Only in the case where the stock is cheap relative to its value, is value created for the shareholders.
In reality these corporate actions are value neutral if the current share price is at fair market value.
The value of ongoing profit is reduced if a company has fewer liquid assets to invest.