Leave the device for a bounded time, then check which enrollment status page phase is stuck: device setup or account setup.

Try a wired or different trusted network and confirm the device can reach the Microsoft enrollment and management endpoints without a captive portal.

In the management console, check which app or policy is assigned to the device and shows as installing or pending at the stuck phase.

Unassign or fix the blocking required app, especially a large Win32 app or a mixed install context, and sync the device.

Restart the device and let enrollment resume; if it hangs at the same phase again, reset the device and re-run enrollment after the assignment fix.

If it still hangs, collect the setup logs from the diagnostic page and check for repeated download or install retries.