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.