from my experience with the same issue, it could be 1 or all 3
1. low freon r12, r123 -whatever it has
2. possible stuck actuator
3. glitchy hvac control (the digital ones can go bad and will do this behavior)
trouble shooting it is difficult especially when it is intermittent
on my 03 I had both low freon and a glitchy hvac control
had it evacuated and refilled-worked better but was still occasionally blowing hot air
replaced hvac control- solved problem completely
previous to the refill and control head replacement it would either just blow hot air, or it would start out cool and after a bit just blow hot air, turning it off/on sometimes worked, turning the vehicle off/on also sometimes worked, sometimes it worked fine the whole trip and sometimes it would work and then while sitting at red light would start to blow hot air and it would have to be power cycled again as above.