I found a bug with the command rm in version 5.5.5 for example in the script
open ftp://user:email@example.com -passive=on
the rm command gets first the properties of the file, but looks into the root folder (MLST /fileonftp.txt, not in the subdironftp. That's why you get the log Can't get attributes of file.... If I use rm subdironftp/fileonftp.txt then it gets the properties, but the delete statement afterwards on the ftp server fails, because it can't find the file subdironftp/subdironftp/fileonftp.txt.
After that I downloaded version 5.6.1 beta, and that works ok with the rm command.