Just to be clear, they appear again without scanning for unmanaged devices again? Than this sounds like a bug. In your queries you will also see devices that are in Pending Unmanaged Client Deployments (in your Console, Network View, Configuration - Right below your 'All Devices' ). Those are Unmanaged Devices that you scheduled for Agent Deployment, but the agent deployment has failed. They are in sort of limbo, between managed and unmanaged. Deleting the scheduled task of the agent deployment or deleting them from the view will get rid of those.
Yes these machines are showing up on Pending Unmanaged client deployments.I have deleted the agent install tasks, but still I see the devices there.
I am trying to delete machines from those groups, but they re appear again.
There is a reason as why you may not be able to erase device from the console but it require investigation and a copy of you database to run some test. SO I would advice that you log a cse via support to have it fix.
Please provide at least 3 device name with that issue as example.