Sorry for the belated reply but I'll throw this out there. My E39 M5 had a similar problem where the the fuel door lock actuator was the problem. It died, unplugged this or pulled the fuse and the keys worked fine. Replaced it, plugged it back in and no issues.
how to install fuel door actuator...... - bimmerfest - BMW Forums
Remote key / fuel door actuator problem write-up
Most issues are mechanical not electrical.