There is a sensor wire that makes sure that the gate is locked before you can roll the window up so that the window doesn't operate with the gate down. It lands on a limit switch at the lock mechanism. Also there is a jumper connection in the corner of the top where the wiper motor plugs in to the truck. It has to be firmly connected. It makes sure the window won't operate when the top is removed. And finally there is a disable switch in the middle console next to the up/down switch, it can screw things up also.
So if you have a loose wire and you ground it out and it fixes it, it may remove the interlocks that keep the glass from breaking if it is accidentally rolled up before the gate is closed. It can break if it is operated with the gate down. Check for the limit switch in the lock mechanism, it sounds like the wire you are looking for.