UI automation actions cannot focus on a window. Depending on the nature of the app, a "Focus window" action may not be able to bring the window to focus. Even if the window is in the foreground, the focus may not be on the window, causing subsequent actions to fail.
To verify that the "Focus window" action cannot bring the window to focus, send some keystrokes on the window using the "Send keys" action. If the window is not focused, the keystrokes won't be sent to the right place.
Send a click on the window. In addition to the "Focus window" action, send a click afterwards to make sure that the window becomes focused. The following actions can be used to send a click on a window:
Click UI element in window
Move mouse to image and send a click
Send mouse click
Move mouse to text on screen (OCR) and send a click