I left the unit to charge for a few days, and it was still the same.
When I looked more carefully, I found that it wasn't a rechargeable battery. It's a CR2477, 3 V 1000 mAh, that had was at or near end of life. There is no way of isolating the battery, so the time on the shelf will take time from the reserve time. The description in the data sheet of the battery being lithium-ion is wrong or at best misleading.
I had bought the timer from ebay. **broken link removed** It is about 4 years old, and doesn't seem to have been used, but the box it was in was in a terrible state. The timer has two circuit boards, a main board and a display board, and where the power from the battery enters the display board, a track had corroded. I suspect that it got damp in storage, and there was condensation on the display board, causing the corrosion.
With the track fixed, and a temporary battery fitted, the display part of the timer works without the mains being connected.
I'm going to order a new CR2477 and I'll also disable one of the output relays, and reduce the capacitor in the transformerless power supply. I only ever want one relay, and the timer runs quite warm, so a lower value capacitor will reduce the heating in the zener regulator.