The actual issue is that, that the place of Namaz should not be narrow or should not be as if anyone wants to stand can’t stand properly. So the place we pray should be like that where we can easily sit and stand therefore it has said that it is makrooh to offer namaz inside the store room or in banker like that place or in a room which is dark or inside the kitchen or at the main entrance (gate or door) or a place where people are moving easily in front of you or a place which is sandy or too much soft (like mattress) etc. And it has logic behind it because these things can distract us. But as you said praying Namaz in a room facing to window has no issue even if it’s open and cars are passing but if you see this can cause you to loose your concentration then better put on the curtain. But your Namaz is okay even if there is no curtain too.