, I did replace the complex command with a simpler command. I replaced it with touch and the touch command executed, I thought that I mentioned that in my first post, that is why I am so baffled at why it is exit(0). I have also tried redirecting the output of the execution to a file, and the remote server doesn't create that file, but the localhost does.
I am logging into the remote server with a SSH key as root, when I'm executing that command, so I don't know why the command would fail.