Its a common problem with alot of cars, even if your cat and sensors are working right.
If you are reading your scanner right( your rear o2 readings are not right ) then its not just a touchy ECM. I would look for air leaks in your exhaust between the exhaust manifold and the rear o2 sensor.
Pressurize your exhaust with a shop vac on blow( tape it to your tailpipe) and then use a spray bottle with soapy water to look for leaks( look for bubbles).
After market cats are not as good as Toyota's but they are much cheaper and work well enough to get past smog, but they dont seem to last as long.
If you have to pass smog and cant have the code showing you can go this route: