Okay, so at least you know it's not that.
I found this:
Common problems that trigger a P0133 code:
- Defective oxygen sensor/air fuel ratio sensor
- Defective oxygen sensor/air fuel ratio sensor heater circuit
- Exhaust system leak
- Intake air system leak
- Low fuel pressure
- Defective engine coolant temperature sensor
- Defective sensor wiring and/or circuit problem
- PCM software needs to be updated
- Defective PCM
It still doesn't make much sense that it only happens when you put it in 4WD though. That seems awfully coincidental perhaps.
Maybe check the wiring going to that O2 sensor and see if there are any exposed / worn wires?