You have a reset global variables action that runs when you exit the level...
Oh god, thank you so much, didn't even know that action exist. Decided to ignore everything that didn't contain name of variables. Mix of this not being my code and unfamiliarity with this kind of action made me do such silly mistake.
Thank you everyone for helping me and saving my time! Sorry and thank you for wasting yours.
I really do feel bad and ashamed for bothering community with this, but it is what it is.