Epicsleeper is correct. You cannot create an object at a location of an object that doesn’t exist.
Events happen in order, from top of the event sheet down. So do conditions. So do actions. While there could be a myriad of other issues with your events, you absolutely must move the “Create object blah at green.X()/green.Y()” action above the “Delete Green” action.