Factors in a different base $\ 2b^2\!+\!9b\!+\!7\,\mid\, 7b^2\!+\!9b\!+\!2$

The long division is the source of the error; you can't have $7/2$ as the quotient. The quotient needs to be an integer, that's what "factor" means.

If the quotient is $2$, then the base is $4$. This is found by solving $7B^2+9B+2=\color{red}{ 2}(2B^2+9B+7)$, and discarding the negative root.

If the quotient is $3$, then the base is $19$. This is found by solving $7B^2+9B+2=\color{red}{ 3}(2B^2+9B+7)$, and discarding the negative root.

No other quotients make any sense. However, if the base is $4$, then you don't get digits $7$ and $9$. Hence the answer must be $B=19$.


Going $1$ step more with Euclid's algorithm reveals a common factor $\,b\!+\!1.\,$ Cancelling it

$$\dfrac{7b^2\!+\!9b\!+\!2}{2b^2\!+\!9b\!+\!7} = \color{#c00}{\dfrac{7b\!+\!2}{2b\!+\!7}}\in\Bbb Z\ \, \Rightarrow\,\ 7-2\ \dfrac{\color{#c00}{7b\!+\!2}}{ \color{#c00}{2b\!+\!7}}\, =\, \dfrac{45}{2b\!+\!7}\in\Bbb Z\qquad$$

Therefore $\,2b\!+\!7\mid 45\ $ so $\,b> 9\,$(= digit) $\,\Rightarrow\,2b\!+\!7 = 45\,$ $\Rightarrow\,b=19.$