The question arises from an exercise but tackles deeper understanding of angular momentum operators.
Suppose we have a 2D harmonic oscillator and an infinite square well in the third dimension:
\begin{cases} \frac{1}{2}m\omega^2 (x^2+y^2), & 0 < z < a \\ \infty & \text{elsewhere} \end{cases}
Consider the degenerate subspace of energy $2\hbar\omega + \frac{\pi^2 \hbar^2}{2ma^2}$. There are two vectors in this subspace, $v_1 = |n_x=1, n_y=0, n_z=1\rangle$ and $v_2 = |n_x=0, n_y=1, n_z=1\rangle,$ assuming $ \frac{\pi^2 \hbar^2}{2ma^2} \neq \hbar \omega$.
We can easily find eigenstates of $L_z$ by expressing it in the form of ladder operators, $L_z = i \hbar (a_x a_y^{\dagger} - a_x^{\dagger}a_y)$, then acting with that on $v_1$ and $v_2$ and diagonalizing the resulting matrix. We find that the eingestates of $L_z$ are $\frac{1}{\sqrt{2}} (v_1 + i v_2)$ and $\frac{1}{\sqrt{2}} (v_1 - i v_2)$, with eigenvalues $\hbar$ and $-\hbar$. We can even explicitly check that by expressing them by the appropriate Hermite polynomials and evaluating $L_z = -i\hbar \frac{\partial}{\partial \phi}$.
The question is - can we find eigenstates of $L^2$ in this subspace? Intuition tells me that the infinite well in the $z$ direction doesn't allow it, but I can't exactly see why. Maybe it has to do with dimensions? The subspace has dimension 2, so $L^2$ has to be a square matrix. But we already found that the projections of $L$ on $z$ are $m=\pm1$, so $l$ would have to be at least $1$ and such an $L^2$ would have at least dimension 3.
In the case of a 3D harmonic oscillator we could find in the subspace $E = \frac{5}{2}\hbar\omega$ eigenstates of $L_z$ with $m=1,0,-1$. I know that they correspond to eigenstates of $L^2$: $|l=1, m=1\rangle$, $|l=1, m=0\rangle$ and $|l=1, m=-1\rangle$, but I'm also not sure how to prove $l=1$ in this case, besides explicitly writing down those states with Hermites and identifying spherical harmonics.
So generally I think I'm missing some intuition involving the relation between energy, $L_z$ and $L^2$ eigenstates.