Not encountered this in an x40.
Is there a pattern forming? Hot/cold/wet days, been running for a long time/short trip, etc.
Does it cut out hard or splutter and die?
Before those questions are answered, the first and easiest thing to check is that the battery terminals are clean and tight. I know it sounds counter intuitive, but I had something similar that was a corroded terminal - and the car started fine.
Beyond that, I would try to get the codes read. Even if the engine light is off, it is entirely possible that there’s a stored code that will short cut a potentially very lengthy diagnosis.