That's when the phone is already on and the screen is locked. If the password is only for the lockscreen, it doesn't interfere with the ability of the phone to connect and receive messages.
However if the password is on a lower level, aka SIM card, the network shouldn't connect
after a restart until the SIM card is unlocked using the 4 digit pin.
Quote:
A SIM card password is a four-digit numerical code that blocks access to the operator's network. In other words, failure to enter the correct password blocks the cell phone from making or receiving calls, sending or receiving messages, and surfing the internet using mobile data (3G, 4G or 5G).
www.perallis.com
ETA to add clarity