Maybe this is fixed in X8 or 2017?
Ariel said:maybe you use the option "treat objects as filled" enabled, then if the outside rectactle is on front of the red square, the program will read the outside rectangle, because is the option enabled. This is one of the first things that i always disable after install the program.
Perhaps it behaves as described by Myron - and by me - even if "Treat all objects as filled" is not enabled.