When specifying an exit 255 in a Unix script or exit 127 in a Windows script, the scheduling manager shows the job remains in a running/exec state.
This is expected behaviour as documented in the Workload Automation Agents
Reference the parameter oscomponent.noexitcode which states:
Specifies the exit code that tells the agent not to send a completion code to the scheduling manager host.
Default: 255 for UNIX, 127 for Windows
Set the oscomponent.noexitcode in agentparm.txt as per the OS type.
Windows: oscomponent.noexitcode=128
UNIX/Linux: oscomponent.noexitcode=256
See WA Agent documentation for more information.