I checked your code and you do a visual verify check on 3Del_dpi_108.png just before “End”. But since “something like this image” is almost always found somewhere on the screen at confidence = 0.6, the status of this command is “true”. Increasing the confidence level of this check to 0.9 should fix it.
A very robust way of detecting that you are done would be the check for the red color of the topmost (-) icon. When this icon is gone, you know you are done.
So what you use is visualGetPixelColor | ${!imageX}, ${!imageY}
. The image X/Y values are automatically provided by the XClick | 3Del_dpi_108.png command that you have. And when the color is red, you know that it was a good click on the right icon.