Just a quick thread that may help others. SES came on, code P0345 came up on cheap scanner. I switched the cam sensors side to side and code P0345 went away and stayed away, but then P0011 showed up immediatelty. Since P0345 is a bank 2 code and P0011 is a bank 1 code I thought maybe the sensor was out of spec. I got one from Carquest, which by the way was a re-boxed genuine BMW sensor, for $64.99. Installed the new sensor and it made no difference. Swithced them again and no difference. Heres the fix!! Took the connectors off both Cam Solenoids or (actuators ) which are just below the cam sensors on each head. Took a striaght pic and gentle bent the contacts slighty so they had more contact pressure on the pins of the solenoids, squeezed Dielectric silicone into each contact hole and put it back together. Erased the code and have been SES free for many miles.
Turns out the sensor was not bad, just a bad connection. This may not fix your problem but its def an inexpensive thing to check.