The error is showing that the deployment is having issues joining the created virtual machines to the domain you have specified in the “AD domain join UPN” field or (if used) the “Domain to join” field. The cause of this would be much like the cause of not being able to join a computer to an on-premises domain. It will more than likely be related to network connectivity or DNS resolution. More times than not, it is related to not specifying the correct DNS servers on the Azure VNet.
It is crucial to ensure that the subnet that you are specifying here has full network connectivity to the same network as the Domain Controllers or Azure AD Domain Services. Also, if you use a new VNet created at the time of deployment, it will not have the access needed to the domain controller by default.
Conversely, if you deploy to an existing VNet on the same subnet, or even to a new subnet in the same VNet, this should work unless there were security settings blocking connectivity between the subnets. You can use normal network troubleshooting techniques to determine if there are routing and port blocking issues, but the name resolution problems may be difficult to find if you are new to Azure.