No you didn't get lucky what you found is to two methods for factoring quadratic polymomials that are a consequence of the $\color{red}{\text{the ac method}}$.
$\mathbf{THEOREM}$. Suppose that $a\ne 0,b$ and $c$ are relatively prime integers and $ax^2 + bx + c$ factors over the set of rational numbers. Then there exists integers $u$ and $v$ such that
$x^2 + bx + ac = (x-u)(x-v)$
$ax^2 + bx + c$ can be factored by grouping as
$ax^2 + bx + c = (ax^2 - ux) + (-vx + c)$
The roots of $ax^2 + bx + c$ are $\dfrac ua$ and $\dfrac va$.
$ax^2 + bx + c$ can be factored by simplifying
$\dfrac{(ax-u)}{\gcd(a,u)}\;\dfrac{(ax-v)}{\gcd(a,v)}$
$\gcd(a,u)\gcd(a,v) = a$
$\mathbf{EXAMPLE}$. $ax^2 + bx + c = 10x^2 -3x - 18$.
$x^2 + bx + ac = x^2 - 3x - 180 = (x - 15)(x + 12) = (x-u)(x-v)$
\begin{align}
ax^2 + bx + c
&= (ax^2 - ux) + (-vx + c) \\
&= (10x^2 - 15x) + (12x - 18) \\
&= 5x(2x - 3) + 6(2x - 3) \\
&= (5x + 6)(2x - 3)
\end{align}
\begin{align}
ax^2 + bx + c
&= \dfrac{(ax-u)}{\gcd(a,u)}\dfrac{(ax-v)}{\gcd(a,v)} \\
&= \dfrac{(10x-15)}{5} \dfrac{(10x+12)}{2}\\
&= (2x-3)(5x+6) \\
\end{align}
$\mathbf{PROOF}$.
We assume that $\gcd(a,b,c) = 1$ and that $ax^2 + bx + c$ has two real rational roots.
The roots of $x^2 + bx + ac$ are $u,v = \dfrac{-b \pm \sqrt{b^2-4ac}}{2}$. So the roots of $ax^2 + bx + c$ are $\dfrac{-b \pm \sqrt{b^2-4ac}}{2a}=\dfrac ua, \dfrac va$.
The next part is ugly, but I couldn't think of any other way to present it.
We need to reduce the fractions $\dfrac ua$ and $\dfrac va$. Let $s = \gcd(a,u)$ and let $t = \gcd(a,v)$
Then $\dfrac ua = \dfrac{u'}{s'}$ and $\dfrac va = \dfrac{v'}{t'}$ where $u' = \dfrac us,\; s' = \dfrac as,\; v' = \dfrac vt,\; t' = \dfrac at$. Then we must have
$$ax^2 + bx + c
= a\left( x - \dfrac{u'}{s'} \right) \left( x - \dfrac{v'}{t'} \right)
= ax^2 - a\left( \dfrac{u'}{s'} + \dfrac{v'}{t'}\right)x +\dfrac{au'v'}{s't'}.
$$
Because $c = \dfrac{au'v'}{s't'}$ is an integer, then $s't'$ must be a divisor of $a$. Lets say $a=s't'a'$. So
\begin{align}
ax^2 + bx + c
&= s't'a'x^2
- s't'a'\left( \dfrac{u'}{s'} + \dfrac{v'}{t'}\right)x
+\dfrac{s't'a'u'v'}{s't'} \\
&= s't'a'x^2 - a'(t'u' +s'v')x +a'u'v'\\
\end{align}
Comparing coefficients, we must have
\begin{align}
a &= s't'a' \\
b &= -a'( t'u' + s'v') \\
c &= a'u'v'
\end{align}
It follows that $a' \mid \gcd(a,b,c) = 1$. So $a'=1$ Hence
\begin{align}
a &= s't' \\
b &= -t'u' - s'v' \\
c &= u'v' \\
u &= t'u' \\
v &= s'v' \\
\end{align}
As a consequence, we find that $s = \dfrac{a}{s'} = t'$ and $t = \dfrac{a}{t'} = s'$
We end up with
\begin{align}
s &= \gcd(a,u) \\
t &= \gcd(a,v) \\
a &= st \\
b &= -u - v \\
c &= u'v' \\
u &= su' \\
v &= tv' \\
\end{align}
If you replace $b$ with $-u-v$, then you find
\begin{align}
ax^2 + bx + c
&= ax^2 - (u+v)x + c\\
&= stx^2 - (su'+tv')x + u'v'\\
&= (stx^2 - su'x) - (tv'x - u'v') \\
&= sx(tx - u') - v'(tx - u') \\
&= (sx - v')(tx - u') \\
\end{align}
Which agrees with the roots being $\dfrac{u'}{t} = \dfrac ua$ and
$\dfrac{v'}{s} = \dfrac va$.
We also note that
$\dfrac{(ax-u)}{\gcd(a,u)}\;\dfrac{(ax-v)}{\gcd(a,v)}
= \dfrac{(stx-su')}{s}\;\dfrac{(stx-tv')}{t}
= (tx-u')(sx-v')$