I had similar problems ones. Turned out to be a corroded connector to the battery in the trunk at one point, and a few years earlier, the connector in the engine bay had the same problem. Worth a look?
'02 ///M5 Imola Red / Imola Red '09 335i Alpine White / Coral Red
'04 E55 AMG Brilliant Silver / Anthracite
'96 318i Alpine White / Black
'01 330Ci Titanium Silver / Coral Red
'96 328i Jet Black / Black