Looks like an O2 sensor problem. Doesn't specify which bank it is though. If your wiring checked out, looks like you'll need an O2 sensor. But with out the full details, I wouldn't be able to give you a straight answer.
BMW Master Tech/Diesel & M Specialist '15 X1 35i(daily) '02 530i (PT6262 turbo/E85fuel) 510whp @ 17psi