If your script needs interactive input, it might fail because of that. SSH will not, when not logging in, allocate a TTY, but just pipe back stdout/stderr and the exit code. Also, it will not invoke a login shell, so any personalized .login/.profile/.bash_profile will be left out. If you rely on a $PATH set in one of those it might fail too.