And if you define the function with a differently named formal parameter, the pattern persists:
sage: g(y)=y^2
sage: g(sqrt(y))
sqrt(y)
sage: g(sqrt(x))
x
so at least it's not the name of the variable itself. Callable expressions aren't the problem. The behaviour is mirrored in variable substitution already:
sage: (x^2).subs(x=sqrt(x))
sqrt(x)
and other powers don't seem to be either:
sage: (x^4).subs(x=sqrt(x))
x^2
sage: (x^(-2)).subs(x=sqrt(x))
1/x
It's most likely some silly bug in pynac. That requires tracing c-code, though.