This is a reasonable thing to be confused about since the terminology reveals an inconsistency between the way computer-scientists talk about functions, pure mathematicians talk about functions, and engineers talk about functions.
First, as you say, there's no way the normal $\sin$ function
$$
\sin: \mathbb{R} \to \mathbb{R}
$$
whose graph is the wave could ever have an inverse. It's not injective and so there would be no logical way to define the inverse; should $\sin^{-1}(0) = 0$ or $2\pi$?
Second, as you note, the restriction function
$$
\sin|_{\big[-\frac{\pi}{2}, \frac{\pi}{2}\big]}: \big[-\frac{\pi}{2}, \frac{\pi}{2}\big] \to \mathbb{R}
$$
is injective. So that logical problem goes away. But there's still the problem that it fails to be surjective, e.g. even after we restrict, it doesn't make sense to ask what the inverse value is at $17$ since no value of the domain maps to $17$.
So we can calculate the range of the sine function, namely the interval $[-1, 1]$, and then define a third function:
$$
\sin^*: \big[-\frac{\pi}{2}, \frac{\pi}{2}\big] \to [-1, 1].
$$
Now this function is bijective and can be inverted. The inverse is conventionally called $\arcsin$. Some people call the inverse $\sin^{-1}$, but this convention is confusing and should be dropped (both because it falsely implies the usual sine function is invertible and because of the inconsistency with the notation $\sin^2(x)$).
Notice that at each step, we gave the function a new name, $\sin|_{\big[-\frac{\pi}{2}, \frac{\pi}{2}\big]}$ and then $\sin^*$ (the former convention is standard in math and the latter was made up for this exposition). This is something that, if we were being extremely literal (for example, maybe if we were writing code that tried to compare two different functions), we would always do. It emphasizes the way we think about functions: the "domain" and "codomain" of a function are part of the data of the function, so a restriction is a different function because we've changed the domain (and dually, if we calculate that the range of the function is smaller than the given codomain, it means we can define a new function with the smaller set as its codomain, and that new function won't literally be the same as our old function even though its values are the same).
This is the kind of thing that engineers don't do for the most part (because the distinction rarely matters and it's confusing to have to introduce a ton of symbols to describe what is, from a calculation standpoint, the same thing), logicians/computer scientists do frequently (because these distinctions always matter in those fields) and most mathematicians do only when there is cause for confusion (so we did it above, since we were clarifying exactly this point -- but in casual usage we would not speak of this $\sin^*$ function, most likely).