Workload Automation AE jobs fail immediately with an exit code of 2.
No stdout/stderr/agent logs are available.
Typically a 4001 exit code is a file not found failure. As a test try providing the full path to your command in your job definition to confirm if that allows the job to run to SUCCESS. If that does work and you wish to adjust the agent's setting so it would make use of the PATH and look up commands rather than you needing to provide full paths then we would recommend you review the following links:
Configure the Agent for Legacy Remote Agent on UNIX
And for even more detail on the agent settings see the Agent implementation guide:
If the 4001 error is not resolved by providing the full path please contact CA technical support and be able to provide the agent's log and spool directories for review.