I struggled with this for awhile, so wanted to pass on how I overcame it.
I was having an issue where the profile would be pushed and everything would be successful, except I couldn't install the AFW, so none of the authorized apps in the Play Store would download (the user didn't have an Android Enterprise account). I finally noticed that, when I looked at the device owner in System Manager > Owners, he had three of the red G symbols next to his name, indicating he had many Android Enterprise accounts.
I deleted the owner, created him again, wiped the phone, and when I authenticated with his user, AFW installed and all of the apps in the Play Store finally downloaded.
We were enrolling devices in Device Owner Mode option A (When prompted for a Google account during device setup, enter afw#meraki. This will automatically install the SM app.) And we encountered this issue described here. We were unable to deploy any apps on the managed phones due to that.
After several attempts, we tried enrolling devices using Device Owner mode option B (In the device's setup wizard, tap the screen 6 times then scan this QR code. The SM app will be auto-installed and auto-enroll the device in the default Network.) and this worked for us.
The issue seems to be related to the version of Play services on newer phones.