just sharing my experience. a few years ago, I had a similar problem. I tried troubleshooting it for a weekend, but I didn't have time to finish. took it to a shop, and it even confuzzled him. he did eventually find out the problem. it was the main crank pully. if you look at it, the rubber vibration dampener is what holds the timing marks for the hall effect pickup for firing the injectors and iginition. the rubber had seperated and the "timing disc" had slipped, resulting in timing being completely off.
I'd go and see if the "timing disc" can be moved by hand, or if there is any play what-so-ever. also, he had to replace the sensor, as he said the disc breaking free smashed into the sensor. he even showed me the old pully. it was completely separated from the main pully. it blew me away. I just couldn't figure out how BMW engineers thought it would be a good idea. I was pissed and happy at the same time. I had my BMW back, but I was completely pissed off that BMW engineers could do something so stupid.