It does work, you do the 3-step XOR with a[0] and a[last], then a[1] and a[last-1], etc. The 3-step XOR from the OP swaps the data.
Here it is with a 4-element array, a[0] through a[3]:
a=[100,200,300,400]
a[0] ^= a[3]
a[3] ^= a[0]
a[0] ^= a[3]
a[1] ^= a[2]
a[2] ^= a[1]
a[1] ^= a[2]
a
[400, 300, 200, 100]
(Pretend this list is an array, it's just for illustrative purposes)