Hi,
Finally I resolved the issue
I've created a plastic workspace on the server that manage all trigger's scripts
The problem was, that in the same folder the script run (and tried to do cm branch delete) there is the .plastic folder of the workspace, and it was not owned by plasticscm user, which run the scripts, thus the scripts kept failing.
Once I changed the ownership of .plastic directory, script is working like a magic.
.plastic is a hidden folder, so it took some time to figure that out.