Using overwolf.windows.restore on closed windows returns error

When i use overwolf.windows.restore() on an open window, for example:

overwolf.windows.restore('main', console.log);

The window opens normally and i get:

{status: "success", window_id: "Window_Extension_pbmdpdeeweffwghrh_main"}

But when i close the window and call again to overwolf.windows.restore() I get an error:

{status: "error", error: "no window with the given id was found."}

Why?

for windows with no instances (windows that not instantiated yet) you should use overwolf.windows.obtainDeclaredWindow() function.