How are you trying to delete the old profiles?
I use https://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/ as a deployment option so you can set an age of profile plus exclude certain local profiles.
Otherwise if your deleting just on the machine, you can delete them via sysdm.cpl > Advanced > User Profiles > Settings (this will delete the local data as well as the registry keys).