EDIT: I created a CAP out of the game I have and it retained the strange error. I'd still like to know what causes it, even if my workaround is mostly better and tidier. Hopefully you can comprehend my code:
I've isolated the problem, and I think it has to do with this:
The way it is, though, is that when you create an object, it doesn't really exist until the end of the next top level event or trigger....
(A top level event is anything which is not a subevent of anything else - I can't remember if events in groups of events count)
I guess groups do count after all, because I moved all of the necessary events outside of the group into the top level of events and it works fine. Check it out: