Clouds, which basically consists of tiny water droplets (not gas), specifically the high, thin variety, AND water vapor (gaseous water), act as barriers to heat escaping. Gaseous CO2 and water vapor, I would imagine, are less of a “physical barrier” than the high, thin, stratus-type clouds. Interesting question. I’ll look into it when I have more time.
Here’s some good info: