Cloning an instance node doesn't create a separate instance

In an internal plugin I’m building I was using .clone() on an instance node to make multiple instances, but then when I would try to manually change properties on one instance in Figma, all of the other clones would have that property change too.

Further inspection revealed that all of the cloned instances have the same node id.

In the mean time I can work around this by creating new instances of the main component, but I’ll also have to set the overrides I was trying to preserve by cloning an existing instance.

You’re right there’s a slight correction I have to make.

All of the cloned instances have a unique id. BUT if those clone instances are together inside a component and then I make an instance of that component, THEN all of the cloned instances share a single id.

Cloned instances inside a component: unique ids

Those same cloned instances inside an instance of that component: All 4 have the same id I15:10512;7140:69940

Here’s a couple videos demonstrating what I was describing when I said “when I would try to manually change properties on one instance in Figma, all of the other clones would have that property change too.”

Changing variant: All of the clones change at the same time AND change their layer name to “Cell Clone 1” (the name of the first of the clones)

Overriding text: Text overrides simultaneously in all the clones

Could you share a link to the example file?