Removing a widget from parent would not cause that. Dereferencing a widget would have the GC scoop it, though. Perhaps OP is creating a new widget every time they re-open it. Or they never reference in the first place. Or they run the randomisation code in Construct
which would fire when re-parented.
@MangoPenguin2601 Show us how you do it.