Here comes the naysayer.
We keep our car unlocked whenever we come home, but over the years there's been a handful of times I've gone to the car and found it locked..........HOW? I have at times hit the lock button by accident and have heard the car lock, but unlocked it immediately, but there have also been times I've gotten to the car and it's locked, so just assumed I, or the wife had inadvertently hit the lock button at some point in time, and just never heard the vehicle lock. With FOB inside, I say and have found that the car won't lock with the FOB inside, but as the OP mentioned locking after 30 seconds with the FOB inside, so.....
Leave the FOB inside, exit and close the door, hit the unlock button and low and behold the door locks in about 30 seconds or so, couldn't believe it.
Don't know the OP circumstances whether another FOB was in the area, but at least I know what happens to our car as to the reason it's locked without ever hearing it do so.