Then the problem is not in the OS but in the code.
Generally speaking, the error message that you indicate is a "timing" error. You perform an action and that action causes objects or components to become visible or available. you then perform another action on those new items.
What it sounds like is that between the first and second action, there is some sort of time delay or other process that needs to be waited for before you can perform the second action. Try putting a "delay" in before the desired action as a test... I would NOT recommend keeping the hard coded delay... it is simply to diagnose. Once we confirm that is the case, then you can start looking at adding things like WaitChild or WaitProperty or something like that.