Matrix A=$\begin{bmatrix}2&-1&-1\\1&-2&1\\1&1&\lambda \end{bmatrix}$
$|A|=0\implies 2(-2\lambda-1)+(\lambda-1)-3=0$
$\implies -3\lambda -6=0$
$\implies \lambda=-2$
But det(A)=0 is not a sufficient condition for no solution.
Infinitely many solutions $\implies$ |A|=0 and rank(A)=rank(A|B)
No solution $\implies$ |A|=0 and rank(A)$\neq$ rank(A|B)
For $\lambda=-2$,
Augmented matrix (A|B)
$=\begin{bmatrix} 2&-1&-1&12\\1&-2&1&-4\\1&1&-2&4\end{bmatrix}$
Apply $R1\leftarrow R1-(R2+R3)$
$\implies \begin{bmatrix} 0&0&0&12\\1&-2&1&-4\\1&1&-2&4\end{bmatrix}$
Apply $R1\leftrightarrow R3$
$\implies \begin{bmatrix}1&1&-2&4\\1&-2&1&-4\\0&0&0&12\end{bmatrix} $
So rank(A)=2 and rank(A|B)=3
Hence $\lambda=-2\implies \text{no solution}$
Alternative approach--
$2x-y-z=12$ $ \ldots (1)$
$x-2y+z=-4$ $\ldots (2)$
$x+y+\lambda z=4$ $\ldots (3)$
$equation(1)-(2)\implies x+y+(-2)z=16$
So eqⁿ 3 will be inconsistent with this equation if $\lambda=-2$