Ok, if someone hits the same issue, I might have found a solution for this. I don't know if that's the proper way of handling it, but it seems to be working ok.
I chaned this bit, and replaced the assertion:
bool isConstant() const override { jassert(ns != nullptr); auto v = ns->constObjects.getValueAt(index); // objects and arrays are not constant... return !v.isArray() && !v.isObject(); }by this :
bool isConstant() const override { if (ns == nullptr) return false; auto v = ns->constObjects.getValueAt(index); // objects and arrays are not constant... return !v.isArray() && !v.isObject(); }