Aloha! I have a USA 2000 Ford XLT with a sunroof which occasionally did not close, but instead sticks in the VENT mode with it slightly open, just like how you describe your predicament. Don't know what your circumstances were when it first happened, so let me relate to you mines:
It began shortly after I first disconnected the batt to do some engine work. Found out that Ford actually says to leave the sunroof in the VENT position BEFORE disconnecting the batt, or else strange things will result. And strange things did happen after reconnecting the batt, like the roof retracting THEN immediately closing on its own; not able to remain in the VENT position; not closing after being in the VENT position, etc.
What worked for me was setting the roof in the VENT position like Ford recommends, then disconnecting the batt again and waiting a few hours. Reconnect the batt, and THEN cycle thru all the positions (Open, Close, Vent). After that, the problem simply disappeared.
This led me to conclude that somehow, one or more of the SUV's computers actually monitors and controls the sunroof! Why Ford might want to design it this way, don't ask me. I surmise that the sunroof controls are integrated with the rest of the electronics, and the computer(s) get "confused" when the power's cut and the roof's in the closed position. My belief is reinforced by Ford's "leave it open in VENT position" instructions. And when the the power's restored, the computers have trouble associating the right commands to the right roof positions.
Whew! OK, try it. I don't know anyone else who's posted a similar problem/recourse and I hope it helps you and others. //LMedina