The reporting of error 0, like many other error conditions, is based on the OS error code returned to PxPlus. The most common OS error that will generate an error 0 is "Permissions Denied" which is all the OS tells is about the operation we performed.
In your case, you could test the value in RET or the contents of MSG(ret) to see if it can provide more details.
Another option is to use the value in STK(-1) within your error handler to obtain the line number where the error occured and then LST(PGM(stno, -1)) to get the actual line of code.