The problem is happening during incremental construction of the DTM model.
It's trying to retrieve information which has not yet been stored,
specifically, the expanded type information for a node which hasn't yet
been written into the tables. But unless we can provoke it under a
debugger, I really can't tell whether this is because it's referencing a
node that hasn't yet been created, or a node which has been created but not
initialized properly. Neither, of course, should be happening.
I've got one off-the-cuff guess... The DOM permits using namespaces without
ever declaring them. It's possible that you're creating this situation, and
that our DOM2DTM code isn't handling it properly. We could try a few
examples and see if we can reproduce the problem that way...
... but if there's any way you can come up with a reliably reproducable
testcase -- maybe add code to catch that exception and serialize out the
DOM which is provoking it, though serializing might wind up masking the
problem? -- that'd be tremendously helpful.