I have Pro Mini board (same 328 processor as Uno & Nano).
Using 2N7000 FETs as switches I was getting odd responses.
When other pins were outputting, Pin 9 would also give an output, sufficient to switch its FET even though Pin 9 is not written into the sketch.
Pin 9 was connected as I thought I might use it as the code developed.
I had used 1Meg gate pulldown resistors.
Another identical board did not exhibit this behavior.
I guess setting Pin 9 as output & writing low ought to fix it but for now I have disconnected the pin.