Here is a tsb on 2001 Pontiac Grand Am sunroof will not close, click here. "This condition may be due to the sunroof motor. Remove the headliner, Jumper Pin #1 and Pin #8 on the sunroof express module.
Notice: Avoid operating the sunroof glass to the full open position. Since the limit switchhas a jumper across it, there will be no indication to the sunroof module to stop the glass at the full open soft stop. The glass can slide past the full open position, possiblydamaging the sunroof assembly and/or the roof.
With the ignition ON, push the sunroof switch to the close position to fully seat thesunroof. If this action fully closes the sunroof, replace the sunroof motor only."
Perhaps there is a procedure in here for closing the sunroof, click here. I am still searching.