Nicla Sense ME and digitalRead

I've encountered that type of issue.
Try using a pull-up resistor (10k, 4.7k, 1k etc.) and try reading it as:

digitalRead(P0_10);
digitalRead(p10);
digitalRead(GPIO3);

And see which one gets the job done. For me P0_10 has always been the most successful, although I have not played with the digital Read too much. It seems that the board supports proper digitalRead/Write only on GPIO0 and 3, everything else causes issues.

Always remember to use pinMode(pin, INPUT);, otherwise you will have issues.

I would recommend if you can to have all your sensors either I2C or SPI, or if not, on the 2 analog pins (including the buttons). The digital pins are sketchy.