my sunroof did this before. You might check this out before you rip your sunroof apart. The switch for the sunroof has 2 contacts for opening and 2 contacts for closing. What's happening, or what happened on mine is that only one of two contacts were making a connection. So there was some power to the motor and it wanted to move, but it just wasn't moving.
I had to pull pull out the switch and pop it open and clean the contacts with some sand paper. It's worked ever since.
Just an idea for you.