Whether if you are using the graph. interface or powershell You'll see an error (image1) if you try to delete files located in a path with more than 248 characters.
The solution that I've found is:
1. Download 7-zip
2. Open this as administrator.
3. Go to the disk of the folder or to the file that you'd like to erase.
4. Press Shift key + Click on using the right button.
5. Click on Delete.