I bought a Panasonic Lumix DMC-TZ5 in a second hand store for 10 euro, battery charger included.
When it was off, the lens was extended. When I switched it on, the lens was retracted and then extended. After a few seconds it said: "please turn camera off and then on again". When I switched it off, the lens remained extended.
The error repeated endlessly.
Then I grabbed the lens and switched it on and stopped it from retracting. It extended to maximum. Then I tapped it twice on the palm of my hand. When I switched it off, the lens was retracted. It was fixed.