As a quick "see if it works to fix it", Find where the power is for the sunroof. Disconnect it for a little while. Re-connect and see what happens. I have a webasco that needs to be "re-booted" periodically.
At this point this is worth a try and will take 5 minutes or so.