Did the KAM / learned values get reset when O2 was replaced.
Seen this exact thing on a Mazda a few weeks ago. The O2 was bad, but learned values were not reset. This caused the PCM to really HATE the new O2 sensor.
Had a 6.7 PSD a few months ago with a leaking DEF injector (external leak). No lights, no codes nothing. Customers complaint was could smell something "burning "
After the repair about 20 miles down the road the truck went absolute ape shit. Warnings on, check engine on, speed limited to 50 mph.
The truck had learned to deal with the leaking injector, assuming the leak started small because when we fixed it, it was a rather large leak. The repair was instantaneous (obviously) and the PCM did NOT like the sudden change in flow rates.
Reset learned value and all was good.
This is something new that was not required 10+ years ago for most repairs so it is new to me.
Clearing codes does not reset learned values.