I've just opened this issue https://github.com/apache/netbeans/issues/5120
It has lots of info gathered at the point of failure. But I suspect the problem comes from things done at project open.
I could compare some things between maven project open and gradle project open if that makes sense.
Any pointers to where those things are in the source code? -ernie