If there is a full match I use figma.variables.setBoundVariableForPaint(), figma.variables.setBoundVariableForEffect() and node.setBoundVariable() to bind local variables instead of what is bound to the layer originally
It works just fine but after each run, I can see these ghost collections added to the page modes