If you are getting O2 heater codes on all four sensors, take a look at fuse F76 (build date 08/2007 and before) or fuse F11 (build date 09/2007 and after).
All four heaters are supplied by this 20A fuse. It's in the junction box fuse panel under the glove box
https://www.newtis.info/tisv2/a/en/e90-m3-lim/i3MQHFP