Injection missing at certain time

Is there a reason you have used flow context rather than node context? Node context is safer if you only want to access the value inside that function node. Then there is no possibility of something else accidentally writing to it.
Other than that I can't see any reason why it might not reset.
Hopefully when it fails the log may tell you something useful.