What vehicle? Year? Engine? What are the actual codes?
Total guess but failing injector and or failing catalytic converter -- or possibly failing O2 sensor. The computer varies lean/rich based on the MAF and output O2. It expects a certain amount of O2 variance between readings before/after the cat which is how it tests cat efficiency (that it is still working).