Thats probably going to be a messed up sunroof regulator. Plastic screw-type drive thingy can strip out or eat debris then once a chunk is gone its toast. If its a 6th gen with a pop-up / slide back sunroof, I know you can drop the overhead console where the switch is, and take the motor loose. Might need a visor loose and the tricky sunroof trim ring off to get access. But if you take the motor loose from the reg, you can cycle it by hand then you'll see. Any grindy noises or notchy operation mean quit messing with it until you can replace the huge regulator. You don't want to have it stuck open lol.