Answer
Check whether the VM is actually getting a stable IP address — configuring a static IP on the Ubuntu VM (rather than leaving it on DHCP) has resolved exactly this symptom, where the deployment script's SSH connection attempt was failing even though the machine itself was reachable and correctly named.