Hi,
I suppose that the pull-up resistor is too small, when you press the button, the pull-up resistor flows a large current, which causes the power supply voltage decreases.
xiangjun_rong_0-1667199048289.png
As the above pic, the pull-up resistor is 100K ohm, pls have a try.
Hope it can help you
BR
XiangJun Rong