We have to click many times to remove the one last dataset when doing the rm command manually.
One does not click at all when using a cli command "manually". I guess you mean, when you use the gui to remove the top directory?
Try a simple test:
rm -rf foo
copy over entire instruction sequence plus any messages that are generated.
type "alias" to make sure rm has not been aliased.
However, there are indications that this can be a bug in the NFS server. This server
sometimes does not allow clients to rm directories recursively. If you have:
A directory a with a file bar inside. When you issue rm -rf /foo, bar gets deleted
but /foo remains and one gets Unkown error 525.
... but I haven't found an actual bug report.
Presumably the workaround is to add an extra rm after the first one, this time just "rmdir a". Alternatively, one can add an extra directory to the tree.