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.
Regarding the last remark, note that for sufficiently smooth $f,u$, we have $$ \int_{u(a)}^{u(b)} f(x) dx = \int_a^b f(u(t))u'(t) dt$$
With $a=0$, $b=1$, $f(x) = x$, and $u(t) = t^2-t$, this will result in
$$\int_0^0x dx = \int_0^1 (t^2-t)(2t-1)dt = 0$$
In particular, note how the change of variables affects the integration bounds.