During the enrollment process if your Provisioning template has "Google Managed Play" enabled then Esper forces the device to upgrade the Play Store libraries that came pre-installed on the device. This is needed in order to use the Google Managed Play Store with Esper on your device.
These libraries are typically large in size ranging from 100-200 MB and if your Internet is intermittent for any reason and the download fails, we cannot add the required Google Account to you device and thus you see this failure while provisioning - "Failed to Add Android-For-Work Account".
Other reasons for this this may be when reseting the device the existing managed account previously used for the device was not removed, or it could be a device or Android OS bug that needs to be taken care by the device maker.
There are several ways to handle this error:
1. If you are not using any Google Play apps using Esper, then you can choose to not add "Google Play Store" in your Provisioning template and we skip updating the Google Play Libraries resulting in faster provisioning. But that device will not be able to install and use Google Play Store apps after that. To do this go to Apps in your Provisioning Template, click Advanced Settings, and then turn off Play Store under the Google Play Store section, and then select Save. The default setting for Google Play Store is set to On for GMS devices.
2. If you do need to have Managed Google Play available on the device, leave the "Google Play Store" on in your Provisioning tempalte and make sure your devices have good and consistent Internet connection to be able to handle the required update to the Google Play Store libraries on the devices.
Note if you select Skip for this step on the device, it will be set up without Managed Google Play Store support using Esper. If you wish for that device to support Managed Google Play after selecting Skip, you'll need to re-provision the device with Managed Google Play Store set to on.