I believe this is what happened. Sommerfeld (1915, p. 430) $=$ (1916a, p. 12) originally introduced an “azimutal” quantum condition and number $n$ such that $\smash{\oint p_\varphi\,d\varphi=nh}$. This $n$ is what we now call the magnetic quantum number $m$.
Then in (1916b) he implicitly switched his azimuth from being $\alpha$ to $\gamma$ in this figure, where the tilted plane would be his “Bahnebene”. As he writes, the resulting “azimutal quantum $n$ splits into quanta $n_1$ and $n_2$ belonging to the coordinates $\varphi$ and $\vartheta$”: $\smash{\oint p_\varphi\,d\varphi=n_1h}$ and $\smash{\oint p_\vartheta\,d\vartheta=n_2h}$. That new $n=n_1+n_2$ is what we now call $\ell$. It measures angular momentum in the direction normal to a putative “orbit’s plane” rather than in a fixed vertical direction.