You need to delete (or retire, or factory reset) the device from Intune before deregistering the device from Autopilot. To delete the device from Intune (not Azure AD), log into the Microsoft Endpoint Manager admin center, then go to Intune > Devices > All Devices. Select the device you want to delete, then select the Delete button along the top menu.
This action removes the device from Intune management and it will disappear from Intune > Devices > All devices. But this action doesn't yet deregister the device from Autopilot. So, the device should still appear under Intune > Device Enrollment > Windows Enrollment > Windows Autopilot Deployment Program > Devices.
The Intune > Devices > All Devices list and the Intune > Device Enrollment > Windows Enrollment > Windows Autopilot Deployment Program > Devices list mean different things and are two separate datastores. The former (All devices) is the list of devices currently enrolled into Intune.
A device only appears in the All devices list once it has booted. The latter (Windows Autopilot Deployment Program > Devices) is the list of devices currently registered from that Intune account into the Autopilot program - which may or may not be enrolled to Intune.
To remove the device from the Autopilot program, select the device, and then select Delete. A pop-up dialog box appears to confirm deletion.
At this point, your device is unenrolled from Intune and also deregistered from Autopilot. After several minutes, select the Sync button, followed by the Refresh button to confirm the device is no longer listed in the Autopilot program.
Once the device no longer appears, you're free to reuse it for other purposes.
If you also (optionally) want to remove your device from Azure AD, go to Azure Active Directory > Devices > All Devices, select your device, and then select the Delete button: