in the sdk_config.h there are plenty of definitions, where "31" is used as a non-valid PIN value
This is destructive if you want to use p0.31
For example:
If one uses nrf_drv_pwm_init with {.driverConfig== NRF_DRV_PWM_DEFAULT_CONFIG} and changing only the pin you like, it will configure pin 0.31 as PWM !
You have to change the sdk_config.h default constants