Sounds like the electric locking mechanism isn't...... (locking). The lock is tied up with the wiper arm assembly on the boot.
It couls also be the glass release button on the wiper arm shorting out, releasing the lock especially if it gets wet. As the glass remains locked when the car is centrally-locked I would think that the switch rather than the lock is knackared.
Strange one. Hope you find the cause and post the result on here.