I think limit basically evaluates the limit of the numerator and denominator. It thinks there are are no problems with either because the terms without z look fine, but, in fact, are exactly zero for all x.

Not sure what can be done in this case. I do see that in limitsimp there is a hack to handle sin(x)^2+cos(x)^2. I suppose we could do trigexpand in addition to the hack, but that seems as if it could potentially complicate limit a lot.