I had a similar issue with a Pico 2 and the Pimoroni Display Pack V2.8. In my case it thought Button A was pressed / held down. Which jives with what your seeing.
@hel Hel Gibbons passed this code on a solution. It fixed it for me.
EDIT: Just realised its the same as what you posted, lol. it’s been one of those days. =)
from machine import Pin
button_a = Pin(12, Pin.IN, Pin.PULL_UP)
button_b = Pin(13, Pin.IN, Pin.PULL_UP)
button_x = Pin(14, Pin.IN, Pin.PULL_UP)
button_y = Pin(15, Pin.IN, Pin.PULL_UP)
if button_a.value() == 0:
# etc etc