Hi Bman
I have the exact same problem in my 1997 E320. Same story, locked one minute and didn't the next, but I can start the car and drive around fine. I have tried the re sync technique, the removal of the negative battery terminal, changing the batteries in the remote...everything that I can that is a DIY fix. Needless to say, I still crawl through the back seat and lock the car with the button on the dash. I have been told that the key needs to be replaced but I IR tested to remote and it is working fine (so its not the key) At least you will be able to lock the car (just be careful not to lock your key in the car. Are you getting any flashing lights on the mirror?
Let me know if you find a fix because I could really use some more ideas. I would really like to be able to fix the problem myself as I have always worked on my own cars. I'm in the process of getting a code reader hooked up to hopefully produce an error code. I have access to an OBD diagnostic machine similar to what Mercedes have...once I get the error code I will be posting what the problem was and possibly how to fix it. Fingers crossed....I'll keep you informed.
Kind Regards
Drew