You have an intermittent electrical issue, where your circuit is intermittently opening up. Possibly a broken wire inside the insulation, but most likely a connector not fully seated or a pin in a connector not fully seated. When the system is not working, you are either losing your 12 volts or your ground. Start checking for power or ground at the compressor clutch, fan, and switch and work upstream until you find where you have it and where it is dropping out and locate the issue. If this sounds like a PITA, it is, but the only other thing I could suggest would be to locate those circuits and carefully disconnect each connector from the device all the way to the fuse boxes and ground terminals looking for unseated connectors or pins. An unseated connector will be noticed because it will unplug without releasing the catch, or you might be able to push together and get movement and feel or here the connector lock up. To check for unseated pins, just gently pull on each wire from the back side of the connector. It should not move, but if it pulls out, that pin was not fully seated, just disconnect the connector and then carefully push the pin back in until you feel or here it click and lock into position. Once locked, a gentle tug on the wire, will confirm the pin is seated as it will not pull out.