When trying to delete a directory that contains files via Webspace > Files, an error is shown and the directory is not removed.
Error Message: failed to remove path
{
"detail": "failed to remove path",
"status": 500,
"success": false,
"title": "Internal Server Error"
}

Via the … sub-menu (on the right side of the file), you can delete individual files.
After that, delete the directory on the left (once it’s empty).
As long as it still contains files, it cannot be deleted.