It will work just as well either way. They are just telling you to put the non-breakable part (the magnet), on the movable object (the window) so you don’t have to worry about the sensor getting knocked off and breaking.
With these reed sensors, the smaller piece is literally just a magnet in a pretty plastic case. Then the other part Has a tiny metal sliver inside like a needle which is called “the reed,” and when the two pieces get close enough together, the magnet pulls the reed into contact Position inside the sensor and then the information gets transmitted to the hub.
So as long as they’re in the same relative positions to each other, it will always work. It’s just that the piece with the sensor is much more fragile, so they usually tell you to put it at the stationary position.