My suggestion still remains. You may need to add a "WaitVCLObject" call to wait for the popup window to appear before you go on to the next step. You may also want to add other such functions.
The "Unexpected Window" error basically means that your test (keyword or script) is not expecting that popup. The popup is getting in the way of you doing something else (clicking on a button on another form) and so it's letting you know you can't do anything.
The solution:
1) Add code to "Wait" for the popup window to appear
2) Do what you need to do to get rid of the pop-up
3) Continue your code from there.
The help files built in to TestComplete have a lot about how to handle such situations. Search for the "Waiting for Object" topic and other related topics.