My understanding of the spacetime metric is as follows: If Alice and Bob witness two light flashes $E1$ and $E2$, and Alice and Bob measures the distance between the position of the two light flashes as $\Delta x_A$ and $\Delta x_B$ respectively, and they also measure the time that elapsed between witnessing the two events happening as $\Delta t_A$ and $\Delta t_B$ respectively, then
$$(\Delta x_B)^2 - c^2(\Delta t_B)^2 = (\Delta x_A)^2 - c^2(\Delta t_A)^2.$$
I have been able to derive time dilation from nothing but this equation, as follows:
$$c^2(\Delta t_B)^2 -(\Delta x_B)^2 = c^2(\Delta t_A)^2 -(\Delta x_A)^2 $$ $$c^2(\Delta t_B)^2\left(1 - \frac{(\Delta x_B)^2}{c^2 (\Delta t_B)^2}\right) = c^2(\Delta t_A)^2\left(1 -\frac{(\Delta x_A)^2}{c^2\Delta t_A^2}\right) $$ $$(\Delta t_B)^2\left(1 - \frac{(\Delta x_B)^2}{c^2 (\Delta t_B)^2}\right) = (\Delta t_A)^2\left(1 -\frac{(\Delta x_A)^2}{c^2\Delta t_A^2}\right) $$ $$(\Delta t_B)^2\left(1 - \frac{v_B^2}{c^2}\right) = (\Delta t_A)^2\left(1 -\frac{v_A^2}{c^2}\right) $$
\begin{equation} \Delta t_B\sqrt{1 - \frac{v_B^2}{c^2}} = \Delta t_A\sqrt{1 -\frac{v_A^2}{c^2}} \end{equation}
Letting $\gamma_B = \frac{1}{\sqrt{1 - \frac{v_B^2}{c^2}}}$
we therefore find
\begin{equation} \Delta t_B = \Delta t_A \frac{\gamma_B}{\gamma_A} \end{equation}
In the case when the events are at the same position in Alice's reference frame, $\gamma_A$ becomes 1, and this equation is the familiar time dilation equation.
Here is where the real question begins: When I try to exploit this same line of reasoning for length contraction, I run into issues.
Lets assume that Alice observes these flashes at each end of a measuring stick, which is at rest with respect to Alice, both at the same time in her reference frame. Then $\Delta t_A = 0$, and we get
$$(\Delta x_B)^2 - c^2(\Delta t_B)^2 = (\Delta x_A)^2$$
We assume now that Alice (and, hence, the measuring stick) are moving at a non-0 velocity $v_B$ when observed by Bob. Now we do the same sort of manipulations we did in the previous case, factoring out a $\Delta x_B^2$
$$(\Delta x_B)^2\left(1 - \frac{c^2}{v_B^2}\right) = (\Delta x_A)^2$$
Immediately I start to see something has gone wrong, since $(1 - \frac{c^2}{v_B^2})$ must be negative (by what I have heard about physics, $v_B^2 < c^2$), thus one of the $\Delta x$s must be imaginary. Indeed if we continue $$(\Delta x_B)^2 = (\Delta x_A)^2\frac{1}{(1 - \frac{c^2}{v_B^2}) }$$ $$(\Delta x_B)^2 = (\Delta x_A)^2\frac{v_B^2}{(v_B^2 -c^2) }$$ $$(\Delta x_B)^2 = (\Delta x_A)^2\frac{v_B^2}{-c^2(-\frac{v_B^2}{c^2} + 1) }$$ $$(\Delta x_B)^2 = -(\Delta x_A)^2\frac{v_B^2}{c^2}\gamma^2$$
But this implies that
$$\Delta x_B = i \Delta x_A\frac{v_B}{c}\gamma$$
That is, we have gotten an imaginary value for the observed length of the measuring stick by Bob! That doesn't make any sense!
I know there are other derivations of length contraction, but I am just not sure why this one isn't working. I have gone over the reasoning several times but I can't seem to find a flaw in it. Specifically, why should this work for time dilation but not for length contraction? Where did I go wrong?