I had a similar problem with a used car. The bottom line was the AC evaporator core had mold on it. After the evaporator core got damp and the car sat for a day or two, the mold activated and made the inside of the car smell putrid for an hour or two - and then this cycle repeated itself. Imagine the smell of vomit, cat urine, and dirty gym clothes at the same time. Ugh. The previous owner could not pinpoint the cause of those odors so to overwhelm the odors they sprinkled perfume/cologne in random places, which created a second odor problem. During the test drive I wrongly guessed the owner had just showered and went nuts with perfume/cologne and it was the seller that I was smelling. Nope.
Over the course of 1 to 1.5 years I repeatedly cleaned the inside of the car including the air vent system trying every product you can name. Febreze, Lysol, vinegar, odor absorbers, ozone generator, carpet cleaner, leather cleaner, and so on. Nothing really worked. It was really frustrating, time consuming, and getting expensive.
Eventually spraying a few cans of home AC coil cleaner from Home Depot into the small area where the car's evaporator core was located killed the mold, and the source of the putrid odor stopped. The last product I used to clean up the smell of the perfume/cologne was something I got at Amazon called Dakota Odor Bomb Car Odor Eliminator with neutral air "scent." The scent temporarily made the inside of the car smell like a hotel room with freshly shampooed carpet or something, and after a month or two that faded and finally the long odor nightmare was over.