Units not deploying when they should

I have this statement that says
if (game_state.turn_number >= 5) and ((game_state.get_resource(game_state.BITS)) >= 14):
and occasionally it does deploy when it reaches 14 bits, but most times it either never deployes or does when the bits become 40 or something. I do not know what the possible reasons it could be.

I would start by making sure the code is at that if statement. If you spawn units somewhere else in your code you might be executing that block instead of where you think.