Of course not.
Take x = 110, y = 101, z = 011. Every bit is set in two numbers, so r = (x xor y xor z) = 0. So x and r, y and r, z and r are all zero, with nothing repeated.
The code you linked to is something totally different. There each number occurs 3 times, except one number X which occurs once. If we count how often each bit is set, then for a bit in X the number of times it is set is 3k+1, for a bit not in X the number of times it is set is 3k times for unknown k.
The code there simulates n counters modulo 3 with bit operations. Totally different. Very clever method. Can be generalised to "for every number except at most one, the number of occurences is a (modulo b) for fixed a and b. Find the value of the one number where the number of occurences is not a (modulo b) or show there is none", running in O (n log b) time.