Based on some of its answers, I suspect Wolfram Alpha does not always treat the same variables as "known" that you do.
Starting with these equations,
\begin{align}
d_x &= x + S\cos(\theta) t + \tfrac12 g_x t^2, \tag1\\
d_y &= y + S\sin(\theta) t + \tfrac12 g_y t^2, \tag2
\end{align}
let $\mathbf x = (x,y),$ $\mathbf d = (d_x,d_y),$
$\mathbf v = (S\cos(\theta),S\sin(\theta)),$ and $\mathbf g = (g_x,g_y).$
then Equations $(1)$ and $(2)$ can be expressed by a single vector equation:
$$
\mathbf d = \mathbf x + t \mathbf v + \tfrac12 t^2 \mathbf g ,
$$
where $\mathbf v$ is an unknown vector such that $\lVert\mathbf v\rVert = S.$
Collect everything except the $t \mathbf v$ term on one side:
$$
\mathbf d - \mathbf x - \tfrac12 t^2 \mathbf g = t \mathbf v.
$$
Square both sides (that is, take dot product of the vector with itself, or in other words, compute the square of the magnitude):
$$
\lVert\mathbf d - \mathbf x\rVert^2 - t^2(\mathbf d - \mathbf x)\cdot \mathbf g
+ \tfrac14 t^4 \lVert\mathbf g\rVert^2 = t^2 \lVert\mathbf v\rVert^2 = t^2 S^2.
$$
Collect all terms on one side and rearrange them to get
$$
\tfrac14 t^4 \lVert\mathbf g\rVert^2
- t^2((\mathbf d - \mathbf x)\cdot \mathbf g + S^2)
+ \lVert\mathbf d - \mathbf x\rVert^2 = 0. \tag3
$$
If we set $a = \tfrac14 \lVert\mathbf g\rVert^2,$
$b = -((\mathbf d - \mathbf x)\cdot \mathbf g + S^2),$
$c = \lVert\mathbf d - \mathbf x\rVert^2,$ and $u = t^2,$
then Equation $(3)$ becomes
$$ au^2 + bu + c = 0,$$
which is a quadratic equation in $u$ and (if it has any solutions at all)
has solutions only of the form
$$ u = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.$$
That is,
$$
t^2 = \frac{(\mathbf d - \mathbf x)\cdot \mathbf g + S^2 \pm
\sqrt{((\mathbf d - \mathbf x)\cdot \mathbf g + S^2)^2
- \lVert\mathbf g\rVert^2 \lVert\mathbf d - \mathbf x\rVert^2}}
{\tfrac12 \lVert\mathbf g\rVert^2}. \tag4
$$
Observe that there solutions only if
$((\mathbf d - \mathbf x)\cdot \mathbf g + S^2)^2 \geq
\lVert\mathbf g\rVert^2 \lVert\mathbf d - \mathbf x\rVert^2 \geq 0$
and if the entire right-hand side of Equation $(4)$ is non-negative (since we must have $t^2 \geq 0$).
Also note that
$$\sqrt{((\mathbf d - \mathbf x)\cdot \mathbf g + S^2)^2
- \lVert\mathbf g\rVert^2 \lVert\mathbf d - \mathbf x\rVert^2}
< \lvert (\mathbf d - \mathbf x)\cdot \mathbf g + S^2 \rvert,$$
which rules out the possibility that
$(\mathbf d - \mathbf x)\cdot \mathbf g + S^2 < 0$
(because if that inequality were true, the right-hand side of Equation $(4)$ would be negative).
But if
$(\mathbf d - \mathbf x)\cdot \mathbf g + S^2 \geq
\lVert\mathbf g\rVert \lVert\mathbf d - \mathbf x\rVert \geq 0$
then there is at least one possible value of $t^2,$ and if
$(\mathbf d - \mathbf x)\cdot \mathbf g + S^2 >
\lVert\mathbf g\rVert \lVert\mathbf d - \mathbf x\rVert$
there are two possible values.
Two possible values of $t^2$ means there is a "high" trajectory and a "low" trajectory, both of which pass through the given target point.
Of course, for each value of $t^2$ there are two possible values of $t,$
one positive and one negative.
A positive value of $t$ corresponds to a projectile
that leaves $\mathbf x$ at speed $S$ at time $0$ and later arrives at $\mathbf d$
(at time $t$),
whereas a negative value of $t$ corresponds to a projectile that first passed through $\mathbf d$ at time $t$ (before time $0$) and then arrived at $\mathbf x$ at speed $S$ at time $0.$
There are always these two possibilities (if the problem has a solution and $t \neq 0$) because trajectories of this kind are reversible.
Assuming you want only non-negative values of $t,$ however, you can take the square root of $t^2.$