I had this happen with an iPad that I received as an exchange when I sent one in for a repair. I booted the new unit up and was prompted to enroll the device in MDM for a school district in Florida. Kind of a frustrating experience, but Apple support was eventually able to get it unenrolled after enough escalations ("yes, I bought it from you", "no, I'm not going to sign in to an MDM-enrolled device with my personal Apple ID", "no, I've never heard of this school district and don't know anyone in IT there who could unenroll the device", "yes, I'm quite sure I didn't buy it off a truck").
I never learned what caused the issue.