I'm converting mid-side to LR.  Originally I used this:

sox $MS $LR gain -0.5 : remix -m 1,2 1,2i

but found that the result does not have an important property of mid-side: when summed to mono, the effect does not cancel out.
I changed it to this:

sox $MS $LR remix -m 1,2 1,2i : gain -0.5

and it works as expected.  Why is there a difference?  Note that there is no clipping going on in either case.  My intuition says that MS->LR is linear, so gain applied before or after should have the same effect.

Thanks!
Jeff