The sliders go stiff with age, corrosion and lack of lubrication. This puts loads of strain on the gearbox, so the gears strip out. Ideally the complete sun roof needs removing, cleaning, de-rusting and repainting. Then it needs to be reassembled, lubricated and new gears fitted to the gearbox. Alternatively close it up, seal the edges with sealer, pull the fuse and forget you have a sunroof.