I think we're misunderstanding each other. He doesn't know what's inside, which is true. However, I'm arguing once he opens a portal he can see what's inside and scan the dimension. If that makes sense.
As for Obito finding Sasuke that was chance, but that doesn't mean he can't scan the...