Maybe some files are still opened and in use, maybe by Anki or any other program. You can try to delete the folder manually, but it’s very likely it won’t be successful and will result in a similar error message.
https://docs.ankiweb.net/#/files?id=file-locations
Restart Anki and try to delete it again. If it won’t help, restart your PC.