I'm one of those that read your post because it was new, but didn't leave an answer because, frankly, I had none. However, after thinking on it a day or so here's my shot...
I agree with everyone regarding battery caused problems (my 2007 went all weird when the battery died after a cold night because the phone charger led's micro power draw kept the danged computer on even with the key off - dopey design.) Here's the rub: (and points to the overdone Government rollover safety feature of latching the rear gate when in drive, then re-latching even after hitting "unlock")...the auto-latching feature is built-in, with the only override option being to disconnect the lock connector. That said, your battery may be flaky enough that the computer module wants to latch regardless of whether you're in Drive or Park...it might be confused. :shrug:
If the battery is good I would try disconnecting it for a few minutes to reboot the computer then see what happens. If not maybe there's a correlation to the shift lever position sensor.
Of course, the other option is someone is messing with you and hitting the lock on the other keyfob when you aren't looking. :laughing1: