Try cleaning first. After that, this procedure to reinitialize the motor controller may help.
Vehicles with new or existing roof opening panel and the glass in the slide, closed or vent range
8. Press and hold the tilt switch.
9. The glass panel is driven in the tilt up direction to the tilt up hard stop.
10. The drive recognizes a hard stop has occurred.
11. The drive reverses the glass panel to the normal tilt up soft stop position.
12. After the glass stops, release the tilt switch.
13. Within 5 seconds of releasing the tilt switch, press and hold the switch.
14. The drive moves through the full closed position to the full open position and back to full closed.
15. Test the express open and express close using the switch.