Gotcha, so it wasn't that the key was near you when you tried to open the tail gate. That was my problem when I thought my tail gate wasn't locking. I would lock the truck and then check the tail gate, and it it would open. Took me a moment to realize the tail gate also is part of the passive key locking system. I locked the truck and put the key far away, the tail gate stayed locked.
I did the same thing.. glad to know i wasnt the only one that let the truck outsmart me haha.