If it's running macOS Ventura and was previously enrolled into their MDM, every time you install the operating system (OSX Ventura), you will be prompted to connect to the internet which evidently means it will be enrolled into their MDM once again.
You can burn a MacOS Monterey image to a thumb drive, install it on the Mac, and when it asks you to select a network, you skip it, which bypasses the enrollment into the company's MDM.
Burning MacOS on a thumb drive from Windows: Since Windows doesn't have native APFS support, I assume you will need to first set up a MacOS virtual machine (others feel free to correct me, I never had done this due to access to a plethora of Macs I have) , passthrough a USB thumb drive to it, burn MacOS Monterey to it from within the virtual machine and then use it on your 2018 MBP.
This will require some trickery, and the solution itself is a bit hacky, but it's managable.