You might need to manually upgrade a switch before adding a switch to a stack if the OS version are too far off. like going from 16.12.4 to 17.3.4
Pre Upgrade Check.
1) Do you already have the OS you want to upgrade copied to a USB Drive?
2) If no, please download.
To download the version of OS you want from Cisco.
1) after logging into the Cisco. select download on the main page.
2) type the product name like 9300 and select your switch model from the choices.
3) select IOS XE software
4) Find the OS you want and download.
5) after download is complete, copy the file to a USB drive.
So now you are ready to upgrade the switch
1) clean up the switch by removing unused packages.
switch#install remove inactive
2) copy the image you want to use over to the switch then remove USB drive.
switch#copy usbflash0:/cat9k_iosxe.17.03.04.SPA.bin flash#
3) set the boot variable
switch#config t
switch(config)#boot system flash:packages.conf
switch(config)#end
switch#wr
4) install the OS
switch#install add file flash:cat9k_iosxe.17.03.04.SPA.bin activate commit
5) once complete you will be asked to reboot, select Y and the switch will reload.
6) when the switch reloads, verify the current OS.
switch#show version
7) optionally you can clean up the previous OS if you want to
switch#install remove inactive
8) since you are going to be adding this switch to a stack or for LAN Automation, why not clear the config
switch#pnpa service reset
Now you want completed upgrading a switch manually.