Corruption or invalid characters in a filename can confuse the system, making it unable to process a delete command. How to Delete Locked Files on Windows
In macOS, a simple "Locked" checkbox in the file's properties can prevent any modifications. delete locked files
Before bypassing the lock, it helps to understand why your computer is holding on to the data: Corruption or invalid characters in a filename can
How to delete 'locked' folders from Trash? - Apple Community delete locked files