Sounds a bit like spurious signal to the ECU telling it to turn on/off. So the first question becomes, "Have you tried turning it off & on again?"
No, seriously. Stop laughing.
Have you disconnected the battery & left it for half an hour or so for all capacitors in the various computers to discharge? This resets all the variables stored in volatile memory in the computers that control everything. It can also remove corrupted data that might be causing the computer to toggle the A/C.
it is the quickest, easiest,
and cheapest step in troubleshooting many problems. If you have, or do, and it doesn't fix it, then you are getting to the realm of hardware problems. Wiring or computer issue. But since it is no longer a simple on/off switch & all done through data busses by computers, I'd be suspecting a computer issue that may need to be fixed professionally, at, (probably), great expense. Hope I'm wrong on that, though, and there may be someone else with better ideas, yet.