Could be that it sometimes takes longer to fully discharge than at other times. When a battery is taken out there is usually some charge still left in the device (someone with electronics knowledge could probably explain it better) and it takes a while to discharge.
Just like, for example, when you change the batteries in a TV remote control. They usually say something like 'put new batteries in within 2 minutes'. No doubt a capacitor holds enough charge in reserve to give you time to change them without fully discharging and loosing all its settings.
Don't know if this is the case here but it could be the reason that all is well some time after the battery has been taken out. The processor only resets after being fully discharged and the time taken for that to happen differs under different conditions.