Put this as the first line in your shell scripts:
#!/bin/bash -ex
-e exits the script immediately if a command exits with a non-zero status.
-x echos the current line in the script when it's executed.
My best guess is that an error occurs in your script, which is silently ignored by Bash, but at the end of the script you still have a non-zero status.
Jenkins checks for that non-zero status and fails.
You can use ShellCheck online, install it on your local machine, and even integrate it with most major editors.
Make sure that ShellCheck says "No issues detected!"
Without actually seeing the code of your shell scripts, it's at this point not possible to give you any further debugging tips.
Hope this helps!
--
Amedee