If the window goes down when you open the door, and then it does not go up, that could also be a sticky door lock microswitch. There is a little switch inside the door lock, which is in charge of operating that behavior in the window:
- When the switch is released (i.e. when the door lock is closed), then the window go all the way up
- When the switch is depressed (i.e. when the door lock is open), then the window will go down a bit to allow opening/closing the door without having the window and the trim overlapping
I had the opposite happening to my 996: the window wouldn't go down when the door was opened, so when closing the door, the window would overlap with the trim. Turns out that my microswitch was too worn, and when the lock was open, it would not make enough contact with the switch to depress it, and thus, the windows would stay up.
Solution was to remove the door lock, and replace the microswitch with a new one. Literally a 2 euro fix.