The mistake in the textbook is the claim that there is such a thing as an eigenvalue of $\mathbf l$. There isn’t.
What do we have at hand?
Three operators $\hat l_x, \hat l_y, \hat l_z :\mathcal H\to\mathcal H$ that take vectors in the Hilbert space $\mathcal H$ of the system and return vectors in the same space. These are the quantum counterparts (“quantizations”) of the classical observables $l_x$, $l_y$, $l_z$, but they do not commute and therefore do not have a common eigenbasis.
For a vector $\left|\psi\right\rangle\in\mathcal H$ in the eigenbasis of a single one of those operators (say $\hat l_z$), the corresponding eigenvalue $\lambda$. By a common abuse of notation, this eigenvalue is also denoted $l_z\equiv\lambda$, and the eigenvector, $\left|l_z\right\rangle\equiv\left|\psi\right\rangle$, leading to the funny-looking equation $\hat l_z\left|l_z\right\rangle = l_z\left|l_z\right\rangle$. I repeat that for such a vector, $\hat l_x\left|l_z\right\rangle =\mu\left|l_z\right\rangle$ does not hold for any scalar $\mu$, and similarly for $\hat l_y$.
For the whole state space $\mathcal H$ (or its subspace, see below), the largest among the possible eigenvalues of $\hat l_z$. By yet another abuse of notation, this is usually denoted $l$.
The operator $\widehat{\mathbf l^2}$ (note the positioning of the hat), i.e. the quantum counterpart of the classical observable $\mathbf l^2\equiv l_x^2 + l_y^2 + l_z^2$ (note that the $l_z$ here is not the same thing as in the previous two bullet points). Because quantization is linear and quantizes powers as powers (up to higher-order corrections in $\hbar$), we also have that $\widehat{\mathbf l^2} = \widehat{(l_x^2 + l_y^2 + l_z^2)}$ is equal to $\hat l_x^2 +\hat l_y^2 +\hat l_z^2 + O(\hbar^2)\,$.
What would, then, be the correct formulation of the statement of the book? As follows: the eigenvalues of $\widehat{\mathbf l^2}$ are of form $l(l+1)$ for integral or half-integral $l$. Also, if we take an eigenspace of $\widehat{\mathbf l^2}$ corresponding to an eigenvalue $l(l+1)$ (it will in general be more than one-dimensional), then $\hat l_z$ would map it into itself, so we can discuss the eigenvalues of $\hat l_z$ restricted to that subspace. The maximum such eigenvalue will turn out to be $l$.
This is surprising, because in the classical case (or, equivalently but more confusingly, in an alternative world where $\hat l_x$, $\hat l_y$, and $\hat l_z$ commuted) the maximum value of the observable $l_z$ among states with a fixed value of $\mathbf l^2$ (call it $\lambda$) would be $l = \sqrt{\lambda}$ (that’s a different $l$!), i.e. $\lambda = l^2$. Not so in the quantum case.
That was the required part. However, if you want to recover your $\hat{\mathbf l}^2$, read on...
So far there is no operator $\hat{\mathbf l}$ that would allow us to define the operator $\hat{\mathbf l}^2 := \bigl(\hat{\mathbf l}\bigr)^2$. Can such an operator be defined? Yes, but it is a bit tricky: it acts by\begin{align*}
\mathcal H\hphantom{\rangle} &{}\to\mathcal H\otimes\mathbf R^3\\[.5em]
\left|\psi\right\rangle &{}\mapsto\mathbf l\left|\psi\right\rangle\equiv
\pmatrix{
l_x\left|\psi\right\rangle \\
l_y\left|\psi\right\rangle \\
l_z\left|\psi\right\rangle
},
\end{align*}
that is, it returns a block vector composed of the component operators; the space of such vectors is called $\mathcal H\otimes\mathbf R^3$, the “tensor product” of $\mathcal H$ and $\mathbf R^3$ (you’ll encounter it in the discussion of composite system, although this particular use of it is unrelated to them). Because it is not an operator from a vector space to itself, it does not even make sense to speak of its eigenvectors or eigenvalues.
We still haven’t defined anything worthy of the name $\hat{\mathbf l}^2$, let alone shown it were equal to $\widehat{\mathbf l^2}$. It can’t be the usual square of an operator, because that definition would require $\hat{\mathbf l}$ to map $\mathcal H$ to itself, and it does not.
The idea is that if we have two operators $\hat{\mathbf A}, \hat{\mathbf B} : \mathcal H\to\mathcal H\otimes\mathbf R^3$, we can compose their “$\mathcal H$ parts” while taking the scalar product of their “$\mathbf R^3$ parts”. This is, of course, fancy language for what you would’ve written anyway: $\hat{\mathbf A}\hat{\mathbf B} :=\hat A_x\hat B_x +\hat A_y\hat B_y +\hat A_z\hat B_z$ (note that it does map $\mathcal H$ to itself). This definition, indeed, somethimes used in both physics and mathematics. In the particular case of quantum observables, we also have $\widehat{\mathbf A\mathbf B} =\hat{\mathbf A}\hat{\mathbf B}$ (up to higher-order corrections in $\hbar$) provided that the corresponding $\hat A_i$ and $\hat B_i$ commute (in particular, if they are equal to each other, $\hat{\mathbf A} =\hat{\mathbf B} =\hat{\mathbf l}$), but not otherwise.