What you are asking is Not exactly clear. But O2 sensors can be slow causing a rich condition prior to throwing any code. A bad temp sensor can do the same.
Same for stuck or damaged injectors or a dirty/wet air filter.
What code are you getting? A more direct answer could be given with the code info.
How rich is it?
A few mpg missing or so rich you could smell the gas in the exhaust?