MKR 1010 Wifi Transistor 3V+ 5V

I do not see a pull-up or pull-down resistor on your push button. You need one unless you declare your pin as INPUT_PULLUP to enable the internal pull-up resistor.