Basically as the title suggests.

My spare key will quite happily start the car, the blade operates the locks, but when trying to program the key to the car it all seems to work and the bong confirming a successful pairing sounds, but key when removed from the ignition to test doesn't operate the locks.

Car is a UK Spec 2004 730D Sport.
Is it likely the battery inside is goosed and won't recharge, I have used it as the main ignition key for a day hoping it would get charged up up but that hasn't helped.