Check belt tension. A loose or slipping belt will trigger the system to shut off the compressor to prevent damage.
You may need a new tensoiner if you are unable to improve the belt slippage.
Also see this thread...might be related.
1995 E300D - No A/C in the rain