Your ring S is not an Euclidean domain, hence sage does not know what you mean by gcd. R2 is an Euclidean domain. You can lift elements of S to elements of R2 using the lift() method, e.g.:
sage: xgcd(f.lift(), g.lift())