I hit this on a new cluster on 10.5 - the Idle URL enterprise param wasn't set. I enabled auto-reg, phone registered but kept trying to query https://ucmpub/cucm-uds/xps/selfProvision, which came up with an error.
Setting the service param did not resolve the issue. I noticed that this was getting hard-coded into the phone's config. I traced this back to the Universal Device Template's configuration. It's another step to change when setting up a new cluster I guess?
In User Management -> User/Phone Add -> Universal Device Template there is an "Auto-registration Template" created automatically with a certain Idle URL. This template is used by default when auto-registering. So change this, or change the Universal Device Template used when auto-registering.
I got the same issue when I changed the hostname of my server.
However I haven't already found a good URL to provide for having an Idle screen