GetInstanceCount() returns 1 after removing an instance

I am having a majour problem.

I have a Hierarchical Instanced Static Mesh Component which can be modified during runtime and can be saved/loaded. When I remove an instance, if I save the game soon after, only the instance which I just removed gets saved. (All the rest get discarded) I checked and it is not a problem in my code. GetInstanceCount() returns 1 for some reason.

I tried looking at the UE source code but I can’t seem to find the problem.

Here is my save code:

for (int32 in = 0; in < i->GetInstanceCount(); in++) {
    FInstanceData d;
    i->GetInstanceTransform(in, d.Transform, true);
    d.Variation = i->Variation;
    OutData[id] = d;
    id++;
}

Where i is of kind class UHISM : public UHierarchicalInstancedStaticMeshComponent object pointer (A custom class)

Anybody has any idea as to why this happens?