The Arduino does not execute commands when I unplug the Arduino.. It only executes commands when I press the restart button

Yes, wait until it is fully connected to the network