Alternatively to being annoyed with yourself, you could view the situation as you having just learned something - that it’s best to keep those items out of your car or at least out of easy reach so you don’t eat without thinking.
It’s fun to view this as a way to figure out things about yourself and learn new ways to inhibit undesirable behaviors.
I had something similar happen the other day. I was doing OMAD but went in to grab some milk from costco and they had a salad sample that looked good and it was down the hatch before I even thought. That day was a 21:3 instead of OMAD. It surprised me more than anything that I didn’t even think before hand.