Let's start with:
- A penny is in my pocket and my pocket in in my pants, so the penny is in my pants.
- The present is in a box and the box is in the garage, so the present is in the garage.
I think we regard these as examples of the transitivity of "in" only by ignoring differences. To be "in a box" is not really the same relation as "in the garage". Here, to be "in" implies certain steps one can take to locate something. Clearly, opening the box is an additional step. All of which gets suppressed. Similarly, and more easily justified: to be "in the pocket" is not the same as to be "in the pants".