Why does my Fob sometimes lock instead of unlock the door?

Probably the ”Intelligent locking” feature is active. ”Intelligent locking” means your Fob unlocks a locked door and locks an unlocked door.
If you have a door with a knob on the outside, you probably want to open the the door. However, the ”Intelligent locking” feature locks an unlocked door.
To prevent this action, simply deactivate ”Intelligent locking” in the Fob settings and configure the button commands of your Fob yourself.