W124's sunroofs are one of the worst features from this lineup, in terms of reliability.
On my wagon I have changed already: the cable, the motor, and the guides. All at different times. Roof always get stuck, and of course, always in the open position.
It sounds like the cable, but check also the roof guides, they tend to brake, bend or get misaligned very easily.