Is it always safe to assume that a integral is zero if it has equal bounds?
The problem is that you cannot directly make a substitution which is not one-to-one on the domain of interest. Thus you can take $t=\sin(x)$, but to do so you need to split the domain between $[0,\pi/2],[\pi/2,3\pi/2],[3\pi/2,2\pi]$.
This condition of being one-to-one can actually be relaxed. Indeed, in general $\int_a^b f(g(x)) g'(x) dx = \int_{g(a)}^{g(b)} f(t) dt$; this is just the fundamental theorem of calculus and the chain rule. But in substitution you need to be careful about using the right $g'(x)$ throughout the entire new interval, which in general amounts to picking the right "inverse" $x(t)$.
For example, naively, you might compute $\int_{-1}^1 x^4 dx = \frac{1}{2} \int_1^1 u^{3/2} du$ with $u=x^2$. But in fact the correct way to do this substitution you find $\int_{-1}^1 x^4 dx = \frac{1}{2} \int_1^0 -u^{3/2} du + \frac{1}{2} \int_0^1 u^{3/2} du$ which is nonzero. This happens because when you pass through $u=0$ you need to switch from one local inverse of $x^2$, namely $-\sqrt{u}$, to the other, namely $\sqrt{u}$.
Hidden parity trick: $$\begin{eqnarray*}\int_{0}^{2\pi}\frac{x\cos x}{1+\sin^2 x}\,dx = -\int_{-\pi}^{\pi}\frac{(z+\pi)\cos z}{1+\sin^2 z}\,dx &\color{red}{=}& -2\pi\int_{0}^{\pi}\frac{\cos z}{1+\sin^2 z}\,dz\\[0.2cm]&=&-2\pi\,\left.\arctan(\sin z)\right|_{0}^{\pi}\\&=&\color{red}{0}.\end{eqnarray*}$$