I ran your example VI and the is what I got in the Error Out cluster:
"Code 1050
Error occured while executing script. Error message from server: ??? This is an error
. in matlab[1].vi"
If you are generating custom error messages in Matlab I would suggest passing them back to LabVIEW through output variables in the script node.