TestComplete only checks for unexpected windows when the script performs an action (Click, DblClick, Activate, etc.). The check does not happen when the script performs certain operations with window properties or when it executes a function, for example, WaitWindow.
This is a crucial functionality in increasing the robustness of the tests particularly when the AUT is not stable. But since the 'OnUnexpectedwindow' only works when an action is performed, it is not suitable in many situations, especially while waiting. There should be some way to handle this better in a straightforward way.
Welcome to the TestComplete Feature Requests board!
Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.