To reproduce, run the following command in chat (while not 500 blocks in the air):
/say @s[y=500,dy=5]
Even though you do not match the region selector arguments, you will still be found. I would expect the player to only be found if they match all arguments, like with other arguments in the @s selector.
Shouldn'ty=500
alone prevent the command from succeeding?