Hi Alex,
Thank you for replying. I unfortunately cannot share the model or a dummy model because of the confidentiality policy.
I eventually got to the problem, I copy pasted an entity from class ModelEntity from an old model into another new model. The name ModelEntity exists in my new model. The internal reference to the ModelEntity class however, is still pointing to the old reference, so not to the ModelEntity of the new model. So the copy pasted entity listens to all inherited functions and methods of the Entity class, but any custom statevariables etc. won't be recognised.