Yes, the exact same script with the exact same subject worked once and then did not an hour later no matter how hard I fought with it. Now I tried it again another 2 hours later (changing nothing) and it worked! Sorry to bother you with this one - I had to post because I suspected the old issue. Thanks as always!
What's really interesting is that you were able to see the directory (and others) with 'ls' but you were not able to remove it. The only thing I can think of is that some other process was somehow holding on to that directory, but I tried to replicate that situation and I didn't get any errors (and it let me remove the directory).
Yes, I did find that puzzling and still don't know exactly what was happening, just that after a while the folder was gone and I could proceed. Thanks!
At least on the cluster, you won't be able to remove the directory if you are on the same node as another process that has the directory open. But if you are on a different node, it happily allows you to remove the directory (and the process continues to run until it is done with the directory).