Can anyone explain why swapping X and Y coordinates breaks box mapping?
Logically, I was expecting it to just mirror the image. It works top down but not on the sides?
The Box mapping uses the direction of the face to determine the mapping. This means that the faces parallel to, say, the Y-axis are mapped as X,Z to the image's coordinates, while those parallel to the X-axis are mapped as Y,Z to the image's coordinates.
By swapping the input coordinates in that way you are upsetting the mapping so that, say, for the faces parallel to the Y-axis are mapped as Y,Z to the image's coordinates - but since the face is parallel to the Y axis, Y is constant - so the image becomes distorted on that face (as only one axis of the image coordinates varies; the other is constant).
Another way of looking at it is: the box mapping algorythm works only with the actual object space. It uses surface normals and their coordinates are not changed according to how you change the object space coordinates. It expects original object space coordinates and stops working correctly if it gets anything else, because it also uses normal vectors that remain the same when you change object space. You can reconstruct box mapping with nodes to be able to control normal vectors it uses as well. If you changed the noramls in the same manner as the object space it should work: