Hmmm.... It may be worth your while doing an ECU reset proceedure.
Sometimes when a new sensor is changed, the ECU has to re-learn all the settings and can retain the old fault codes as a reference point... So when the new sensor was installed, the ECU settings would have been out of whack in relation.
Its worth a try and it's free to do m8
1. make sure all doors are unlocked and drivers window down.
2.remove battery negative for 20 minutes(make sure you have the radio code first)
2. re-fit the negative cable.
3. while leaning through the window, insert ignition key and turn to last position (all full ignition lights on dash)... Leave it for 90 seconds and then turn back to everything off again but keep the key in the ignition barrel.
4. now start the engine but do not touch the accelerator pedal, let it settle and leave it ticking over for 20 minutes.
5. take it out for a spirited drive through out the rev range and then you are done.... ECU has been reset and has re-learned the new settings