Thinking about this a bit more, I'm thinking that the selector switch might need to be cleaned/replaced. Might be part of the control unit.
What you stated that the AC sometimes works and not at other times, lead me to this thinking.
2000 WJ Grand Cherokee Black 236,000+ miles
Needs: Left rear wheel bearing. Front right CV joint.