WagnerJ:
Ok, got it working perfectly on my spare UNO. Will have to figure out why the same code doesn't want to work on my Leonardo. The only thing I changed in the code are the lcd pin numbers.
How long are the cables from the Arduino A0-pin to the shields buttons and resistors?
Probably long cables crossing other cables with mains power or chhanging currents, and the cables are catching electrical interference, so that no stable analog reading is possible.
With the LCD Keypad Shield directly stacked on the board, cable lengths are short und signals from the button to the A0-pin are undisturbed.