All the doors on my E39 open and close as they should using the remote key.
The problem is that the passenger front door, when opened, does not close properly. It appears that the door locking mechanism does not engage with the catch on the car body.
When this happens, I've found the only way for the door to close shut is with the passenger door open, to use the remote first to close all doors, then to open the doors. After this, the passenger door when opened can be closed and stay closed as it should.
I'm unsure whether this is an electrical fault or a mechanical one. Advice appreciated.