I can't delete the created widget

Just to clarify, you set the input of DestroyComponent from the output of a node that is not executing in that path. Note how the branch’s white lines goes in two separate ways? You can’t use nodes from one branch in another branch unless they have no white execution pins. So the DestroyComponent node isn’t going to do anything. It’s as if it isn’t there. And don’t try to make it execute as that would just create a new component and delete that while doing nothing to the original component.

As the other response said, you need to store the component in a variable. That way, when the other branch is run at a later time, it will have a reference to the component.