Well, the gate threshold voltage of the STL100N10F7 is between 2.5V and 4.5V, meaning that an unfavourable specimen may not be able to conduct (see data sheet, fig. 8, Transfer characteristics).
Instead of the STL100N10F7, you could use a low gate threshold MOSFET (known as a logic level types), e.g. the STL160N6LF7, whose threshold voltage is between 1.2V and 2.5V and which typically reaches its maximum current at 3.8V (see data sheet, fig. 6, typical transfer characteristics).
However, I also noticed that you are apparently connecting the voltage divider R30/R31 with its impedance of 180k||20k = 18k directly to the ADC input of the MCU. Please note that this only makes sense for the STM32U5 at resolutions of max. 8 bits; for higher resolutions, an impedance converter or lower-impedance resistors are strongly recommended (see data sheet, search term ‘input impedance’).
Regards
/Peter