No the reason it's wrong is that you should return the money to shareholders only if you expect them to be able to generate more ROI than the company can. Shareholders don't generally have access to investments with >20% average ROI.
They're not saying to avoid doing the investment, they're saying to give the money to shareholders and then borrow it again. If they can borrow the money at e.g. 6%, the shareholders could plausibly have access to investments that return more than that. It also lowers their risk because they keep the money they've already been paid even if things go south, whereas if the company keeps the money and then loses it, it's gone.
They're not saying to avoid doing the investment, they're saying to give the money to shareholders and then borrow it again. If they can borrow the money at e.g. 6%, the shareholders could plausibly have access to investments that return more than that. It also lowers their risk because they keep the money they've already been paid even if things go south, whereas if the company keeps the money and then loses it, it's gone.