The 2018 BMW M5 has 3 recalls, the most serious being a software defect in the engine control unit that can cut power to the fuel pump and stall the vehicle without warning.
A separate fuel system issue involves the fuel level sensor getting stuck against an in-tank fuel line, causing the gauge to show more fuel than is actually in the tank. A driver relying on that reading may run out of fuel unexpectedly, also leading to a stall. There is also a backup camera recall affecting a wide range of BMW models from this era: the camera image can fail to appear when reversing, leaving the driver without a rear view and raising the risk of a collision or striking a pedestrian.