I'm seeing mixed responses, so it may be a locality thing as to whether machines generally accept cash. For example I remember almost all machines in Japan accepting cash.
The machines at the Whole Foods near my house, for example, only accept cards, phones, or palm prints. Only half the machines at a Safeway near my house accept cash. The machines at another grocery market (Haggen's) are card- or phone-only, and they furthermore show a video feed of you on the screen with a "You're Being Watched by AI" warning to try to cut down on thefts.
The last time I tried checking out at one of those machine it flagged me as trying to steal something because the system didn't know that a container of chips I had were free with the sandwich I bought.