By Claude:
With algebraic : true, gcd can fail with a division error instead of returning a result:
(%i1) display2d : false$
(%i2) algebraic : true$
(%i3) gcd(expand((x+1)*(3+(sqrt(a)+sqrt(b))*x^2*y)), expand((x+1)*(y+x+x^2)), x);
PTPTQUOTIENT: Polynomial quotient is not exact
-- an error. To debug this try: debugmode(true);
(%i4) p : z-w*x$
(%i5) gcd(p, expand(p*(sqrt(z+w)*x-1)));
PTPTQUOTIENT: Polynomial quotient is not exact
-- an error. To debug this try: debugmode(true);
(%i6) f : x-sqrt(z)$
(%i7) gcd(expand(f*(z*x-1)), expand(f*(x-sqrt(z+1))), x);
PQUOTIENT: Quotient by a polynomial of higher degree (case 2b)
-- an error. To debug this try: debugmode(true);
(%i8) r : sqrt(sqrt(z)+1)$
(%i9) h : r*z^2+sqrt(z)$
(%i10) gcd(expand(h*r), expand(h*(z^2-sqrt(z)+1)));
`quotient' by `zero'
-- an error. To debug this try: debugmode(true);
The first three gcds are x+1, z-w*x and x-sqrt(z), and Maxima 5.49.0 returns them. For the last one it returns 1. With gcd : subres, red, algebraic or mod, 5.49.0 fails as well. Since commits 948338e38 ("Fix '$SPMOD GCD for polynomials with algebraic variables") and 6742a2304 ("Fix infinite loop in GCD $EZ/$MOD with algebraic variables"), gcd : spmod, the default, and gcd : ez use the same code for polynomials with algebraic numbers, so the errors now occur with every setting.