I have the code, but it does nothing. Debugging reveals that when I click on the object, it says that the inspected item is destroyed when it's not destroyed. Which makes me think it's destroying and creating on the same frame.
That's probably what happens.
In addition to Debug Mode, use browser logging.
Add "Browser Log" action to the event where items are created and destroyed. In preview press F12 and open console - you will see how often they are created/destroyed.