If you encounter an error when enrolling a device, you can do the following:
Enroll the device again using a mobile hotspot for the Wi-Fi connection to find out if the network is the issue.
Ensure that there are no restriction in place that prevent enrolling from a specific location.
Ensure that an MDM profile is not already installed on the device.
If you still have problems enrolling the device after checking these possible causes, you may need to wipe the device (when using Apple Configurator or automated device enrollment) and restart the device enrollment process.
If you contact Jamf Support, they may ask you to create a log file using Apple Configurator 2. For more information about how to create a log file, see Export device info in Apple Configurator on Mac in Apple's Apple Configurator 2 User Guide.