what are using to scan the car with, needs to be good enough system to cover all p-codes and live data on all controllers to stand a chance of working it out.. first off how many miles has car done, if on n18 engines over 70k has the timing chain been checked, i have had a few of them where others have given up after changing all you have to find the real issue chain is stretched and engine is running out of time, this cause the 02 sensor upstream to try and trim the fuelling that is incorrect due to un burnt fuel air mix being dumped on it due to the over lap on inlet and exhaust valves etc,,, i always tell people on these prince engines before throwing money at it guessing you need to know its timing is bang on, as 02 sensors have so much to do with the amount of fuel demanded ie fuel pressure trim,,
the N18 runs same chain kits except for a longer tensioner that was stuck in by bmw to help prolong the point the top guide snaps off and destroys the motor,, in my view its lip stick on a pig should of fitted a duplex high grade chain to fix the issue, so N18 will no higher mileages but means they rarely rattle before going bang so no warning except for running issue,,,
as for 70k that based on a car treated nice and not ragged and not ever let oil level get below half way as these cars do a lot less seen 24k before due to owner thinking it only needed oil when under the min make or red light flickers,, least to say thats all kinds of stupid,