The O2 sensor is part of the exhaust and should not have any correlation to gas cap. I'm not familiar with the RL but on Legends they only get set by either the O2 heater problems or the actual sensor. How many miles do you have on the RL? O2 sensors usually last 150-200k unless they get corrupted by something they don't like such as coolant, silicone, or leaded gas.