That's what most people do for a repeatable issue, but there are "gremlin cases" where a car in otherwise good repair will somewhat randomly set a MIL code.
Wife's 2005 CR-V will around once per year set P0325 (knock sensor, bank 1). I've replaced the knock sensor [twice], rang out the wiring, and checked/cleaned all the connectors. It's a 17.5 year old car with ~225K miles on it that sets a code once a year. It's not going to get any more fixed than it already is.
Catalytic converters are an expensive fix. It might not be worth it to fix the car.
Alternative option is to sell the car to someone in a state that does not require emissions testing.
Also, if someone steals your catalytic converter, and there is not much damage, it is possible to “straight pipe” it for cheap and just not put in a catalytic converter. Although, I would assume inspection stations have cameras or mirrors where they can see the bottom of the car, so this might only be worth it in states that do not do inspections.