In general you can write the projection matrix very easily using an arbitrary basis for your subspace. Look at this.
So for your case, first finding a basis for your plane:
$$x-y-z=0\Longrightarrow x=y+z$$
$$\{\begin{bmatrix}
1\\ 1\\ 0\end{bmatrix},\begin{bmatrix}
1\\ 0\\ 1\end{bmatrix}\}$$
Now let $A:=\begin{bmatrix}
1 & 1\\
1 & 0\\
0 & 1\end{bmatrix}$, your projection matrix is $A(A^tA)^{-1}A^t$. Computing it by hand is not hard but I prefer to put the Maple computation for you here:
A := Matrix([[1, 1], [1, 0], [0, 1]]);
P := A.MatrixInverse(Transpose(A).A).Transpose(A);
The result is:
$$\begin{bmatrix}
\frac{2}{3} & \frac{1}{3} & \frac{1}{3}\\
\frac{1}{3} & \frac{2}{3} & -\frac{1}{3}\\
\frac{1}{3} & -\frac{1}{3} & \frac{2}{3}\end{bmatrix}$$
Now the matrix you showed at the end of your question. If you extend an arbitrary basis of $W$ which of course it has 2 elements, to a basis for $\mathbb{R}^3$ and then indexing these three vectors in the way that the new added vector be the first then representation of $P$ in this new ordered basis is $\begin{bmatrix}0 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix}$ because say $B:=\{v_1,v_2,v_3\}$ be this ordered basis then basis of $W$ is $\{v_2,v_3\}$, in the new coordinate:
$$v_2=0v_1+1v_2+0v_3\longrightarrow v_2=\begin{bmatrix}0\\ 1\\ 0\end{bmatrix}$$
$$v_2=0v_1+0v_2+1v_3\longrightarrow v_2=\begin{bmatrix}0\\ 0\\ 1\end{bmatrix}$$
Now letting $A:=\begin{bmatrix}
0 & 0\\
1 & 0\\
0 & 1\end{bmatrix}$ We have:
A := Matrix([[0, 0], [1, 0], [0, 1]]);
P := A.MatrixInverse(Transpose(A).A).Transpose(A);
The result is:
$$\begin{bmatrix}
0 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1\end{bmatrix}$$
But pay attention this representation of $P$ is not in the standard coordinate, it is in the new coordinate system given by the ordered basis $B$.