That's because you have a (pretty clear) syntax error in your script. You have:
ocnxlOutputExpr("getData("M1.m1:gm" ?result 'dc)" ...)
The problem is that you have quotation marks in the expression, and these are embedded within the string expression. So the string ends at the first quotation mark (so it just contains "getData(") and then some free text appears, and then you have " ?result 'dc)" - these are all stuck up against each other end hence you get syntax errors. It even tells you where they are!
So you need to escape the embedded quotation marks:
ocnxlOutputExpr("getData(\"M1.m1:gm\" ?result 'dc)" ...)