csrutil disable
Restart computer
In the terminal, type
sudo open /Applications/TextEdit.app /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist
change
<key>com.apple.ManagedClient.enroll</key>
<true/>
to
<key>com.apple.ManagedClient.enroll</key>
<false/>
So that the changes take effect
I have used a paid online MDM check and my Mac is still enrolled.
Model: MacBook Pro (15-inch, 2018) Space Gray Wi-Fi [A1989] [MacBookPro15,1]
Serial Number: C02XXXXXXX
MDM Lock: ON
Thank you