I use the correction given in this post :
and it works !
vi /var/www/nextcloud/lib/private/Files/Storage/Local.php
Go to line 127
unset($it); // <---- Add this line before RETURN. --------------
return rmdir($this->getSourcePath($path));
For the files in the error list (history), I only delete the sending tasks in the error list.