Let $\operatorname{sgn}(x)$ be the function that takes values $-1, 0, 1$ depending on the sign of $x$.
For the sake of generality, if you have two variables $x$ and $\theta$ related by $x = \sin \theta$ and the square root symbol means to always take the positive square root, then the opening post is correct: the right formula relating the differentials is
$$ \frac{\mathrm{d}x}{\sqrt{1 - x^2}} = \operatorname{sgn}(\cos(\theta)) \mathrm{d} \theta $$
Now, one thing to note is that the domain of these functions excludes $x = \pm 1$; similarly, it excludes all values of $\theta$ for which $\cos(\theta) = 0$.
On this domain, $\operatorname{sgn}(\cos(\theta))$ is locally constant. In this situation, the domain consists of a series of completely disjoint intervals $$\ldots \cup (-3\pi/2, -\pi/2) \cup (-\pi/2, \pi/2) \cup (\pi/2, 3\pi/2) \cup \ldots$$
"Locally constant" means any function that is constant on each of these intervals, but can have different values on different intervals.
Nearly everywhere in calculus where you learned something involving constants is actually about things that are locally constant
For example, since $\operatorname{sgn}(\cos(\theta))$ is locally constant, its antiderivatives are all of the form
$$ \operatorname{sgn}(\cos(\theta)) \theta + C(\theta) $$
where $C(\theta)$ is also locally constant. (note that we need a local constant of integration, not merely a constant of integration!)
Now, if we were so inclined, we can extend this formula to the domain of all $\theta$ by lining up all of the constants. The end result is that the antiderivative is a constant plus the sawtooth function depicted below:
Image produced by Wolfram alpha
As an example of seeing how this working, suppose our goal was to compute the integral
$$ \int_{-1}^1 \frac{\mathrm{d}x}{\sqrt{1 - x^2}} $$
While unusual, we can rewrite this as
$$ \int_{-\pi/2}^{5\pi/2} \operatorname{sgn}(\cos(\theta)) \mathrm{d} \theta $$
This isn't an invertible substitution, since each value of $x$ corresponds to three different values of $\theta$ (barring a few exceptions). But one-dimensional integration is very robust, and we should still expect to get the right answer if we have the details right.
And we do; if we take the sawtooth function above as the antiderivative, then the integral becomes
$$ \left( \frac{\pi}{2} \right) - \left( -\frac{\pi}{2} \right) = \pi $$
which is the correct answer — and the same answer we'd get by only integrating over $(-\pi/2, \pi/2)$.
Of course, if we aren't interested in the greater generality, we can just simplify by insisting that $\theta \in [-\pi/2, \pi/2]$ and simply take $\theta + C$ as the antiderivative, thus avoiding any hassles with the sign.