Look at it this way: We can express a plane wave as
$$\mathcal{E}_z(x,y,t) = \cos(k_x x + k_y y - \omega t)$$
where I've assumed a $z$-polarized wave propagating in the $x$ and/or $y$-directions. In phasor notation this can be written
$$E_z(x,y) = e^{i(k_x x + k_y y)}$$
where I've used the convention
$$\mathcal{E}_z(x,y,t) \equiv \text{Re}(E_z(x,y) e^{-i \omega t} )$$
In order for this wave to satisfy the wave equation, we must have
$$k_x^2 + k_y^2 = k^2$$
where $k$ is the propagation constant in the medium, and is real and positive. For a propagating wave, $k_x, k_y$ are real and $|k_x|, |k_y| \le k$, and they can always be written
$$k_x = k \cos(\theta)$$
$$k_y = k \sin(\theta)$$
for some real angle $\theta$.
What happens when, $|k_y| > k$? This can be the case for the solution in the refracted medium of the interface problem, and corresponds to total internal reflection.
$k_x^2 + k_y^2 = k^2$ must still be satisfied, which means that $k_x$ must be purely imaginary. The full time-dependent signal then looks like
$$\mathcal{E}_z(x,y,t) = \cos(k_y y - \omega t) e^{ik_x x}$$
Here the electric field is decaying, or evanescent, in the $+x$-direction and there isn't any energy propagating. Physically, this means that the wave is oscillating in the $y$-direction faster than what is physically supported by the medium, which is why it must die out in the $x$-direction. There's no longer a direction of propagation, so there's no apparent reason to find a $\theta$.
In my opinion, that's pretty much the whole story. However, there is also Snell's law which states $n_1 \sin (\theta_1) = n_2 \sin (\theta_2)$, where $\theta_1$ is the angle of incidence, $\theta_2$ is the angle of refraction, and $n_1, n_2$ are the indices of refraction. In the case of an evanescent wave in the refracted medium, if we wanted to solve for $\theta_2$, we would find that $|\sin(\theta_2)| > 1$, which is equivalent to $|k_y| > k$. Clearly, that also implies that $k_x$ and therefore $\cos(\theta_2)$ are imaginary.
Obviously, for this to be true, we must use the following generalizations of sine and cosine which allow complex arguments
$$\cos(\theta) = \frac{e^{i\theta} + e^{-i\theta}}{2}$$
$$\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}$$
Note that if we choose complex $\theta = (\pi/2 + n\pi) + i I$, where $I \ne 0$, we will get
real $\sin(\theta)$, where $|\sin(\theta)|>1$ and imaginary $\cos(\theta)$.
Is there a physical reason to calculate such a complex $\theta$? Maybe not, but the math is clever. And it's nice to see Snell's law hold even for the case of total internal reflection.