In a perfect world… reality is different, however.

Plenty of companies take on debt to pay dividends, e.g. just before going public.

growing companies generally have capital needs that exceed retained earnings, so paying dividends would by definition increase capital need.