I actually had a situation where the dealer disabled the electronic keys entirely (and by accident). They had disconnected the battery for some electrical diagnosis and neglected to re-enable the locks.
When I noticed this, many days later (!), I had to take the car and both keys back for them to reprogram. I expect the car was programmed to accept the keys, and not the other way round.