Regardless of the angle of the dangle, shooter needs to get the muzzle out of the vertical plane of the wall/window sill. In doing so, he is a target, he is not back in the room, and thus can be shot and hit.
Arguing will not change that, nor will angles and hypotenuses and other bullshit.
So, if the muzzle is 9 inches above the floor and 1 inch back from the window and pointed downwards at 15 degrees below horizontal the bullet wouldn’t go out the window? That one inch back from the window would be enough to disprove your contention. The actual distance back that the muzzle could be (with a 9 inch elevation above the carpet) is 36 inches. But don’t worry about it dude. I’m sure you have other skills beside math. And shooting.