It is by design. WinExist wasn't
intended to be used that way.
Checks if the specified window exists
Use ahk_id HWND ... to identify a window or control by its unique ID.
The ahk_id criterion can also be combined with other criteria that the given window must match.
You can't
specify multiple windows. It's not explicitly stated that each criterion can only be used once, probably because the authors never considered specifying multiple.
WinTitle is not interpreted directly by WinExist or any other public function, but by an internal shared function (
WindowSearch::SetCriteria). The string is parsed exactly once for each call to WinExist, forming a set of criteria stored in a binary structure (
WindowSearch). The criteria are then evaluated against each top-level window. There can be many windows to evaluate, and WinTitles can be evaluated very frequently, so the separation of parsing from window evaluation is probably very important for performance.
The behaviour you are expecting would be useful to have. It seems a shortcut can be made specifically for ahk_id: if two different IDs are present, there can never be a match, so there is no need to store multiple IDs or even evaluate any windows.
@lmstearn that is exactly as expected, because "123ahk_id" has no special meaning in the WinTitle parameter.
Specify one or more of the following ahk_ criteria (optionally in addition to a window's title), each separated from the next with exactly one space or tab