I think we have your answer, unfortunately it won’t help fix your issue unless you are able to perform an unencrypted backup.
This article sheds quite a bit of light on the topic of our discussion: https://support.apple.com/guide/deployment/back-up-and-restore-devices-depd44f045b4/web
The first thing that stood out to me was this mention in the article:
When a device is backed up, the management configuration is contained in the backup. This configuration describes, among other things, whether a device is supervised or a Shared iPad. Backups must be encrypted when using profile-based Device Enrollment or Automated Device Enrollment for the MDM enrollment profile to be included.
This leads me to believe that the iCloud encryption is automatically including the management configuration that existed on the phone when you created the backup. You removed the device from your MDM and AMB, but the configuration still existed on the phone when the backup was created so it is going to reappear on every restore from this particular backup. Backups created in iCloud are always encrypted, so using this backup method will always ensure that the management configuration remains when using this backup to restore a device.
It’s honestly starting to look like you need to weigh out which of these two items is more important:
1) Removing the erroneous management notification
OR
2) Having an encrypted backup to restore from
If option 2 is more important, then you are stuck with the erroneous management notification. If option 1 is more important then you should be able to use iTunes on a Mac to create an unencrypted backup which should exclude your management configuration and remove the management notification upon restore. If the device is in your possession I would highly recommend at least testing this to see if the management configuration gets removed on restore.
Note: unencrypted backups do not include the following information:
- Any saved passwords
- Call history
- Health data
- Website history
- Wi-Fi settings
Final note: I’m unsure of whether or not this device is still considered as “owned by an organization”, so it might be best to create your unencrypted backup on a Mac. Per Apple:
Neither Apple Devices for Windows nor iTunes for Windows should be used for backups of devices owned by an organization.