I created a situation that it will definitely not work...
Here's a simple diagram.
(Black curtain over window) (Bright light source)
(Black curtain over window)
(Black curtain over window) (Phone)
The test was conducted in a room with -parallel walls on both sides. And this somehow made the phone thinks that there's something very close to it and hence does not sense movement/waving.
After removing the phone from that position for about 10 secs, it showed the glance screen again and everything worked fine again.
Total bright and dark conditions in my test did not have this effect.