When you try deleting a folder from within SharePoint, the option for deletion just simply isn’t there. If you go to Classic mode, the option is there but you’ll get an error message telling you that you must delete the folder from within Teams.
The problem is that the folder was created as a channel within Teams. That channel was deleted but the folder remains. Apparently, there are two options here, wait it out for 21-30 days until the deletion retention expires or option 2.
Option 2 is to create a new folder, move the stubborn folder over to it and delete the new folder.