Let us assume that $$A=\left[\begin{array}{rrr}2&-1&-1\\-1&2&-1\\-1&-1&2\end{array}\right].$$
Then, eigenvalues of $A$ is $0, 3, 3$.
For $\lambda_1=0$, I could find its eigenvector as $\begin{bmatrix}1\\ 1\\ 1\end{bmatrix}$.
For $\lambda_1=3$, I could find its eigenvector as $\left[\begin{array}r0\\ 1\\ -1\end{array}\right]$ and $\left[\begin{array}r0\\ -1\\ 1\end{array}\right]$.
Thus, I set $S=\left[\begin{array}{rrr}1&0&0\\1&1&-1\\1&-1&1\end{array}\right]$ and $\Lambda=\begin{bmatrix}0&0&0\\0&3&0\\0&0&3\end{bmatrix}$.
The problem is $S\times \Lambda \times S^{-1}$ does not give $A$.
By matlab, $S$ is given as $\left[\begin{array}{rrr}0.5774&0.7634&0.2895\\0.5774&-0.6325&0.5164\\0.5774&-0.1310&-0.8059\end{array}\right]$
Using $S$ given by matlab, $S\times \Lambda \times S^{-1}$ gives $A$.
The textbook said the $i$th column of $S$ must be the eigenvector corresponding the $i$th eigenvalue of $A$.
I think this problem happens because two lambdas are same as $3$.
How can I find correct $S$?