There was an error while loading. Please reload this page.
Sorry for not following bug report model but the issue is also reported on nextcloud and fixed
https://help.nextcloud.com/t/unable-to-delete-directories-text-file-busy/86468/3
Adding unset($it); as they say on forum post fixes it