We know that an atomic orbital wavefunction may be written in terms of polar coordinates, $$\psi (r, \theta, \phi) = R(r) A(\theta, \phi)$$ where $R(r)$ is the radial component and $A(\theta, \phi)$ is the angular part.
There are many orbitals of interest, but in particular I'm interested in applying a symmetry operation on $d_{xy}$. We know that the angular part of this orbital is $\sin^2 (\theta) \sin(2 \phi)$. Suppose I want to rotate only along one axis, let's say $\theta$, so I fix $\phi$ and rotate $\theta$ by $\pi/2$. This means that the rotated orbital is now written as $A(\theta + \pi/2, \phi)=\sin^2(\theta + \pi/2) \sin(2 \phi)$. We know from trig. that $\sin(a + \pi/2) = \cos(a)$, therefore the angular part of our transformed orbital may now be written as $$A(\theta+\pi/2, \phi)=\cos^2 (\theta) \sin(2\phi)$$
however, graphical approaches to this problem for the real orbital suggest this $\hat C_4$ rotation should give back $-d_{xy}$. What am I missing?