reset the module
I'm not sure about the S-class, but I had a similar problem with my 88 BMW 735i. The windows, sporadically, wouldn't close or open. My fix was removing and reinserting both the relay module and the circuit board (control) module. It worked fine ever since.