@Batman, John , From your description, it seems that our issue is the script is still running on the device after we remove the devices from the assigned group. If there's any misunderstanding, feel free to let us know.
For our issue, we suggest to choose one affected device, Go to Settings->Accounts->Access work or school, and sync policy on our account. Afterwards, restart the affected device and see if the script is still running. Meanwhile, check the device status for this affected device in Intune portal to see if the device record will disappear.
Please try the above steps and if there's any update, feel free to let us know.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.