The rear hatch on my 08 E83 disengages a few minutes after it is securely closed. I had a similar issue with a faulty actuator on an E34 Touring some years ago. As one would expect, the rear compartment lights illuminate once the hatch becomes ajar and drains the battery. I'm wondering if a lubrication of the latch will resolve the problem or make it worse (?). As always, advice appreciated.
If it is latching then opening could be a faulty latch or a button/ switch that is intermittently sending the command to open. So to make sure it it the latch I would unplug the interior button and the switch on the trunk lid. Close the lid and see if it pops again if not its one of the switches. Also keep the key far enough way from the vehicle because it could also be doing it.