I suggest not removing those rm_* files, so that you can verify what is in them when it fails.
Also, consider running the script via "tcsh -x", just to capture all the commands and output. That might have a lot of output, but should make debugging much easier.