There's an error I can't fix

Just test this one and it works fine. Instead of wires all around, I saved the created widget in variables.

Since 2 pieces of code are the same, I used a macro Remove. To create it, go to left panel, press to add new macro and set this logic and inputs/outputs: