Blueprint works only in Editor

Very often, the run order or timing varies quite a lot between play in editor and other modes.

It’s a timing problem. Something is not quite ready when you think it is. I don’t know what exactly that is, because I don’t know your setup, but if you trace your code back, you can find it.

You probably need to put some debugging print nodes in there to help you find it.