Here's some advice from me. Whether you choose to apply it to debugging a coding problem, or just understanding general behaviour that a program is exhibiting, try doing the follow:
Assume the entire issue is like a murder mystery. First you need to establish a motive. You also need a means and you need opportunity.
When debugging, it is easy to guess at some components motive and jump straight to their guilt. For the ultra intuitive, this can often work out really well. But for everyone else, it leaves them stumped as to what went wrong when jailing the component does not stop the crime from repeating.
Establishing a motive requires that you find a means for the motive and an opportunity. The likely component may have a close relationship to the crime in question, but it may not have the right opportunity. More than likely, a component will have an obviously opportunity but an unobvious means (this is where intuition shines).
This likely hasn't helped at all or made any sense. Good luck.