Maybe it is shadows! My 2018 M3 does it as I pass a semi on my right, when I'm about mid-truck, boom, brakes pretty hard. Occurs pretty regularly, I now anticipate it and keep my foot on the pedal at that moment to counteract it. Always in broad daylight, I believe.
Recently ran a red light...