It is not uncommon for fresh O2 sensor to uncover lingering issues and t0 start triggering codes.
So this could be one cause, the other cause is possibly the O2 sensors/wiring is mixed up.
Here is my dissertation on mixed up O2 sensors/wiring:
1. These cars have 4 O2 sensors
2. 2 pre-cat O2 sensors, 2 post-cat O2 sensors
3. BMW never marked the connectors on the engine compartment harness, BIG mistake.
4. The pre-cat and post-cat sensors have different genders.
5. Pre-cat sensors have female connections, post-cat sensors have male connections. See these examples (Special NOTE, these may not be the exact sensors for your specific car, just an example):
Pre-cat -
http://www.boschautoparts.com/Vehicl...part_num=13477
Post-cat -
http://www.boschautoparts.com/Vehicl...part_num=15109
6. The pre and post cat sensor connectors can plug into each other, BIG MISTAKE.
7. People can screw up the connections on these sensors because they are not marked and people do not pay attention. Here are the following possibilities:
a. The pre-cat sensor wires can be plugged into the opposite bank engine harness connectors.
b. The post-cat sensor wires can be plugged into opposite bank engine harness connectors.
c. The pre and post cat sensors can be plugged into each other and if this happens usually at least one bank on the engine hardness can be plugged into each other.
8. Universal sensors or sensors with the wrong gender connector can be purchased and someone can cut and splice the wiring. This can actually lead to the O2 sensor swings be 180 degrees out of feeding data backwards to the DME, Lean when Rich and Rich when Lean.
9. The last and hardest thing to do, but ANYTHING is possible, someone buys 4 new O2 sensors and then puts the post-cat sensors in the pre-cat position and not thinking just decides to connect up the engine bay harness. This basically puts the pre-cat sensor input to the DME in the post cat location. Then bank to bank swap can even happen on top of all of this mess!!
So if you look at the options above, use your imagination, almost anything can happen. So you are best to have an OBDII scan tool, but you can also swap the pre-cat connectors to the engine bay harness just to see what happens. The options are likely the engine runs better or the engine runs worse. There could be a no change situation as well, but I doubt it.
Most of the time, I just approach a problem as a full unknown, assume everything is wrong/bad/broken/connected and/or adjusted wrong. The start down my mental check list and verify things one step at a time. It can be time consuming, but this approach may save hours at the end of a mess!!
If you start to sort out the O2 connections, LABEL the connectors on BOTH the engine harness side and the sensor connector side!
So hopefully this is about as clear as mud?
Good luck, but the sooner you have a decent OBDII tool, the quicker you can figure out your mess or at least figure out what is working and connected properly on your car.
Also read this thread about how graphing/fingerprinting O2 sensors can show how clearly there may be an O2 sensor issue -
http://forum.e46fanatics.com/showthread.php?t=1041726&highlight=
Also read the 1st link below in my signature.
It is not clear if the Bank #1, Sensor #2 really had anything to do with the lean code as the lean code is actually for Bank #2.
How about Freeze Frame data and Fuel Trims?? This will really help understand what may be going on.