i had the same problem on my e36.
what you have to do is put the key in and pull the lock button out, lock and then unlock the drivers door and retry.....
it could take a few goes but it will work, then, once its open change the locking mechanism.
hope this helps.
stu, January 2007