It appears to me that your solution threw some error messages, like this one;
System.Exception: Failed while getting Orders ---> System.Data.SqlClient.SqlException: Login failed for user 'nw_user'.
But it did not change the return code to a non zero value.
Usually what I do in cases like this, is build a UC4 FILTER object and attach it to the OUTPUT.SCAN tab of the job. The UC4 FILTER feature can automatically scrape your reports for text strings and you can tell the OUTPUT.SCAN tab to set a non-zero return code when it gets a hit. Or better yet, build a FILTER object that scans for a "good end of job" message. That way any sort of unexpected error message would be trapped.