It should only happen occasionally, not regularly. If the latter, see the dealer. It usually happens to me when I am coasting to a stop and stomp on the brake to stop before I hit the car in front of me. I can't remember the last time I did this as I have learned to coast and brake gently. I am guessing there might be a lag between braking and shutting off the motor. A very non-engineer guess.
Separately, yesterday, I switched to P before I had come to a complete stop. Talk about lurching! Not recommended. Distracted driver at work clearly.
Jeff in NYC
MB '17 B250e; MB '06 E500W; MB '81 380SL