There are plenty of workers. The shortage is the number of people willing to bag groceries for the offered wage and work conditions. Companies can solve this pretty easily.
(For some businesses, yes, they could accept less profit. Those tend to be the ones that raise wages when they can't get enough workers, because they have the incentive to do so.)
Is there a reason it's particularly difficult to bag your own groceries in the USA?