Yes it can be misleading but if you use firebug and look at the net panel you can see that the parameter that you pass to the server when you execute an identify task is 'layers=all' or 'layers=visible'. So it is clear that your server cannot know which layers are currently visible in your client. So it is obvious that it takes the visibility of layers in your mxd.
Give points to thank better 🙂
Davide