Most of my experience is with other (non beemer) cars. I've never looked at how my starter motor is wired so I'm probably talking complete scroll-locks., but, in my mind, missing earth strap can stop the starter cranking properly coz it's getting v+ direct from battery via starter solonoid but earths through the body of the starter to engine block then to the chassis via that earth strap. If strap is missing then, when cranking, all that current tries to find earth via other cables which can't handle the current and you have strange burned out wires and other stuff.
But once engine is running it ought to keep going. You say it won't idle. Exhaust stinks of unburned fuel etc. In the old days before all the computer m'larky I'd be looking at ignition coil, electronic ignition potentially breaking down so frequently missing a beat and blowing unburned fuel into the exhaust.
But all the computer m'larky is supposed to monitor and diagnose all this stuff. So I haven't got a clue what I'm talking about.