• OK I got it! I did not understand that the value read in the outregister was not representative of the actual value. It is a bit confusing because on Pico and other platforms based on STM32 a pin can easily be set to 'output' while still readable by digitalRead().

About