I had this old bullet hell boss rush game I made some time ago. I quit working on it because of a bug and I just wanted some information. The main mechanic of the game was that the boss would throw a bomb at you and you could suck it up and throw it back at the boss. On the third boss I was working on I used a scene variable to detect which phase you were on. When it was equal to 1 it would attack and when it was equal to 2 it would drop the bomb and go back to 1. But when it went back to one the boss would still continuously fire the bombs at the same time it was attacking. The boss is only supposed to fire the bombs if the phase is 2.
Perhaps post a pic of your related events?
This is your first line on defense about variable bugs
You print to text your variable to check what it is at a current moment
And then you can figure out if problem is with variable or something else