Funny enough you don’t need to root a phone for MDM generally because otherwise “bring your phone to work” systems would never work. It’s a very classic case of “rules for thee but not for me” because it gets in the way of corporate profit.
That being said the only open source MDM I’m aware of with real capability and stability is https://fleetdm.com/. I would stay far away from anything vibe coded or even just younger than a year
EDIT: after looking at it, it appears Google locks MDM capability though “Android enterprise” or whatever the fuck that is and you need to tie it to a domain name so ymmv