Is there an explanation of what's wrong with the original solution and why you need an apoc call to solve the problem? (I'm also curious as to what the error was. If I get around to trying this out, I'll post the errmsg.)
I'm not sure why apoc calls are needed here. I get the feeling this is a bit similar to SQL in Spark with UDF's, but my intuition on all this isn't well developed yet.