I used names unique in the context of the page and it seems that I am not getting the expected instance (instances have globally unique names)
What do you mean ? WIndow name should be unique in the context of the page, but you can have multiple windows with the same name on different pages