You can control the movement of out of stock items in the Shipment by going to Company Settings > Basic Settings > APP SETTINGS tab > ALLOW TO DELIVER EVEN OUT OF STOCK, you can choose the suitable settings and save.
If you select No, don't allow to deliver even out of stock, the system will prompt an error message to prevent you from delivering the out of stock item(s).