You see unprintable characters because \2\1\3 have meaning in a regular python string too, as octal escape codes:
>>> '\2'
'\x02'
>>> 'xMain \2\1\3'
'xMain \x02\x01\x03'
They never make it to the re.sub() function as written.
Use a raw string literal instead:
b = re.sub('^xMain (\S+)/y1,/y0 (\S+ )(.*)$', r'xMain \2\1\3', a)
Note the r'...' string. In a raw string literal \... escape codes are not interpreted, leaving the back-references in place for the re module to use:
>>> r'xMain \2\1\3'
'xMain \\2\\1\\3'
The alternative would be to double the backslashes, escaping the escape:
b = re.sub('^xMain (\S+)/y1,/y0 (\S+ )(.*)$', 'xMain \\2\\1\\3', a)
Either way, your replacement pattern now works as expected:
>>> import re
>>> a = 'xMain Buchan/y1,/y0 Angus Sub1'
>>> re.sub('^xMain (\S+)/y1,/y0 (\S+ )(.*)$', r'xMain \2\1\3', a)
'xMain Angus BuchanSub1'