Just to clarify your problem:
1) It seems entirely random?
2) It cannot be reproduced except by repeating the action until it doesn't work?
3) Once it doesn't work, it will continue to not work until application restart?
I think I remember having a similar issue a couple times over the years where popup lists would stop popping up, requiring application restart to fix. Make sure you have the latest updates and try running recovery to see if there might be corruption.
Any chance you just need a refresh at the end of the script?