This is an answer both to the OP and to @GuyFsone, who does not understand my objection. And it's too long for a comment.
The original question is
What is going on here, I cannot find any mistake...
Let's have a look at a substitution in an integral. Wikipedia tells us that
$$\int_{\phi(a)}^{\phi(b)} f(x)\,dx = \int_a^b f(\phi(t))\phi'(t)\, dt$$
Where $\phi$ is a differentiable function defined on $[a,b]$. Actually, it needs only be defined on $]a,b[$ (you may then get an interval on an infinite interval as a result of the substitution).
Notice, the variable in your original integral is $x$, and for the substitution one has to write $x=\phi(t)$. Usually, one thinks of substitution backwards, and you would write $t=\psi(x)$, but this is only valid if you can invert the function $\psi$, to write the substitution $x=\phi(t)$ as needed. To invert a function, it has to be a bijection. Here you have chosen $t=\sin(x)$, with $x\in[0,\pi]$, and you can't invert the sine on $[0,\pi]$.
Notice that $\phi$, on the other hand, needs not be bijective: it's because you wrote $t=\psi(x)$ in the first place that you have to invert the function $\psi$ to get $\phi$.
Now, how could we do that properly, even with a periodic function? The cotangent comes to mind, as it's defined and bijective on $]0,\pi[$. The inverse is arccotangent, or $x=\mathrm{arccot}(t)$.
A note about definitions: the cotangent is $\pi$-periodic, thus has no inverse on $\Bbb R$. You have to pick an interval where it's bijective. Here, the obvious interval is $]0,\pi[$. If you want a plot of this arccotangent, have a look at this. The plot shown by Wolfram Alpha is another possibility, but it's not the one we want here. The former is the same, with a constant $\pi$ added for $t<0$. The derivative is thus the same where they are both defined. The former, that we will use here, has the advantage of having image $]0,\pi[$ as we want, and also of being differentiable on $]-\infty,+\infty[$.
Now, for $t\in]0,\pi[$, $\dfrac{\cos^2 \mathrm{arccot}(t)}{\sin^2 \mathrm{arccot}(t)}=t^2$, hence $1=(1+t^2)\sin^2\mathrm{arccot}(t)$ and
$$\sin^2\mathrm{arccot}(t)=\frac1{1+t^2}$$
Likewise,
$$\cos^2\mathrm{arccot}(t)=\frac{t^2}{1+t^2}$$
And of course, $\dfrac{\mathrm d}{\mathrm dt}\mathrm{arccot}(t)=\dfrac{-1}{1+t^2}$
The substitution is therefore:
$$\int_0^\pi \sin^4(x)\cos^6x\mathrm dx=-\int_{\infty}^{-\infty} \frac{t^6}{(1+t^2)^6}\mathrm dt=\int_{-\infty}^{\infty} \frac{t^6}{(1+t^2)^6}\mathrm dt$$
This integral isn't very easy. You first have to use partial fractions:
$$\frac{t^6}{(1+t^2)^6}=\frac{1}{(1+t^2)^3}-\frac{3}{(1+t^2)^4}+\frac{3}{(1+t^2)^5}-\frac{1}{(1+t^2)^6}$$
But the integrals of each terms get quite long (see this). It was merely an example to show how substitution can be made correctly here.
Another way to use substitution, still with $t=\sin(x)$, is to use it on an interval where the sine is bijective. If you integrate on $[0,\pi/2]$ and $[\pi/2,\pi]$ separately, it will work. See zipirovich's answer.