here's the description for the code
P0420 - Catalyst System Efficiency Below Threshold (Bank 1)
There are two O2 sensors in your exhaust system. One measures exhaust gases before the catalytic converter, and the data is used by the engine management system to adjust the fuel feed. The second, "downstream" O2 sensor is locates in the exhaust pipe after the catalytic converter, and it is used only to monitor the efficiency of the converter, by comparing the values between the two sensors. Because the converter is between the two, the later sensor should detect much cleaner exhaust gases if the converter is working right.
With time, two things inevitably happen: the converter efficiency goes down, and the sensor accuracy is reduced or it stops working.
So... your computer is telling you that the second sensor is reporting insufficient operation of the catalytic converter. The real cause is either just that, a failing converter, OR a failing sensor reporting wrong values.
I would first replace the O2 sensor, because they have a shorter lifespan than the converters. If the problem repeats, then you need a new converter. Usually when you replace a converter, you should replace the O2 sensor(s) too. But this way you already have a new one in there. With luck, the O2 sensor is all you need. With bad luck, you also need the converter. This is a logical way to approach it and it starts with the lowest cost repair first.
This code cannot be a result of a loose gas cap. Other codes can, and Double checking the gas cap was a good move though, a first step when the light comes on. Most people don't think about it or know about it.
The problem is not critical. The catalytic converter is just getting worn, and not cleaning the exhaust gases as good as it should. In somewhat rare cases they can start crumbling and clogging up internally, and then they can cause driveability problems due to restricted exhaust flow. You are not there yet. Your only problem now is increased emissions. The car won't pass emissions testing.