Find the point $P$ on the $x$-axis which orthogonal projection on the line $r:x+y=z-1=0$ is $M=(1,-1,1)$. The points such as their orthogonal projection on the line $r$ is $M=(1,-1,1)$ lay on the plane that passes through that point $M$ and that is orthogonal to $r$.
First of all, then, I determined the directional vector of the line, which is (one can also write $r$ in parametric form and infer it):
\begin{equation}
\mathbf{v}_{r}=(1,1,0)\wedge(0,0,1)=\begin{vmatrix} \mathbf{i}&\mathbf{j}&\mathbf{k}\\1&1&0\\0&0&1\end{vmatrix}=(1,-1,0)
\end{equation}
This vector is parallel to the normal vector of the searched plane $\pi$. Thus, the Cartesian equation of $\pi$ is found via dot product. Precisely, I impose that the scalar product between the normal vector of the plane $\mathbf{n}$ and the direction of the vector linking a generic point $A=(x,y,z)$ of $\pi$ and $M$ is zero:
\begin{equation}
\pi:(x-1,y+1,z-1)\cdot(1,-1,0)=x-1-y-1+0=x-y-2=0
\end{equation}
The point I'm looking for is given by the intersection of $\pi$ and $r$. Hence, I write $r$ in parametric form and substitute in the equation of $\pi$:
\begin{equation}
r:\begin{cases} x=t\\y=-t\\z=1
\end{cases}
\end{equation}
Substituting in $\pi$ gives: $t+t-2=0\Rightarrow t=-1$. 
In conclusion I find the point $P=(-1,1,1)$ whereas $\mathbf{\text{the correct solution is } P=(2,0,0)}$.
What did I do wrong? 

The correct solution is in fact, as you say, $(2,0,0)$ and this can be deduced very easily because either all happen in the plane $z=1$ and the point $P$ is on the $x$-axis so $P=(x,0,0)$. Therefore you can act likely as you were in the plane $XOY$ as follow:
The distance of $M$ to $O$ is equal to $\sqrt2$ so you have a right triangle of sides equal both to $\sqrt2$ so the hypotenuse is equal to $2$ because
$$x\cos 45^{\circ}=\sqrt2$$ 

