The expansion valve controls the release of the compressed gas to cause the cooling effect. It's fitted into the small radiator type device (I'm sure it's got a technical name

) under the dash that the inlet air fllows through to be cooled.
My old car did a similar thing because the expansion valve was icing up and stopping the gas flowing. It would cool for a few minutes and then blow hot air for ages, then a bit of cool air , then hot for ages.....