if it locks then reopens the car - the fob is ok. the signal is being recieved by the car. so there is no fault with the electrics.
The fault u have i suspect is mechanical cause.
when you press the lock button - check out every door - and see if you can see that all doors interior door lock buttons are flipping closed.
what i think you may find is - one of them is not flipping closed. this then tells the other door modules that it is open - and refuses to allow the other doors to stay locked.
the fix for this will be replace the door latch that appears to be siezed.
i hope this sorts the problem for you.