There is no problem. See the comment by @BabyDragon above.

Note that the integrand satisfies $f(\frac{\pi}{2}-x) = -f(\frac{\pi}{2}+x)$ over the range of integration, so the answer is zero.