Hi,
I ran into similar problem and unfortunately I don't have explanation why it happens like that.
I pretty sure what is the reason of the problem - process definition is not loaded for the process instance (Execution) that you are examining. I would suggest a workaround to get it working. Check if process definition is present on your execution and if note use ProcessDefinitionQuery
repositoryService.createProcessDefinitionQyery().processDefinitionId(processInstance.getProcessDefinitionId()).uniqueResult()
and set returned object on your execution.
That should solve the problem.
You can as well do it manually by checking process definition your self to find correct node by its name (currently executing one).
HTH
Maciej