Have Toyota Questions? Ask a Mechanic for Answers ASAP
Try holding the close button for 30-60 seconds, this will over ride jam protection if it is a factory installed sun roof.
If you tested power to the motor can you test power to the switch?
It may be mechanically bound, like some thing fell in to the tracks and jammed it up.
You could also remove the motor and see if it turns when hitting the button.
Also you can try manually pushing the roof down with the motor removed.
Try removing motor, motor acts as a brake to hold sunroof in desired location. when you remove motor, either the motor will spin and you sun roof is mechanically bound, or the motor will not spin, but you will be able to push roof to the closed position.
Yes it is easier with head lined removed, if you have to, you can remove front pillar moldings and sun visors to drop head liner a little to have easier access to it. I will look for a picture of the motor.
Do you still require assistance if not please accept my answer, I'm here to answer more questions if need be.
Please accept and rate my service!!