1997 Mazda 626 CEL and rough idle

Sometimes, especially in cold weather, the Check Engine light on my 1997 Mazda 626 LX (manual transmission) will come on and then the engine runs rough or will even die at idle. The check engine codes are:
P0140 02 Sensor Circuit No Activity Detected (Bank 1 Sensor 2) and,
P0420 Catalyst System Efficiency Below Threshold (Bank 1)
After a few days the check engine light goes off and everything is fine.
I’ve taken it to several shops when the check engine light is on and no one can figure out what is wrong.
Any ideas?

A couple of ideas

  • the egr system is failing. If this tends to happen right after an acceleration, defintetly consider that the egr valve may be sticking open. EGR problems can cause O2 sensor and CAT codes.
  • you may have a bad cat that has failed in a way that the honeycomb core has detached from the case. When it gets jiggled around, sometimes it orients so it blocks the flow of exhaust gas, and other times it re-orients and doesn’t.

Thanks. I’ll look into both.

I forgot to mention that the check engine light only comes on after a drive of 20 minutes or more. Short trips do not cause the problem.

Either of the two ideas above are consistent with that too.