I've had most tailgate window problems, but not this one !
I'd start by resetting and recalibrating window. Shut tailgate, disconnect battery, leave for 5 mins, reconnect and window should drop. Then, with tailgate closed raise window to full height and try again.
Otherwise I would suspect the tailgate open switch is faulty and is confusing the CCU about where the door actually is, open or closed.