How do I solve this fractional indices equation $\frac{{3}^{5x+2}}{{9}^{1-x}}=\frac{{27}^{4+3x}}{729}$?

Solve the equation $\frac{{3}^{5x+2}}{{9}^{1-x}}=\frac{{27}^{4+3x}}{729}$

I thought that the best way of approaching this would be to rewrite everything using 3 as the base of the exponents, hence creating an equivalence which would allow me to equate numerators to numerators, and denominators to denominators. Doing this yields:

$$\frac{{3}^{5x+2}}{{3}^{2(1-x)}}=\frac{{3}^{3(4+3x)}}{{3}^{6}}$$

Equating the exponents of each numerator:

$$5x+2=3(4+3x)$$

$$5x+2=12+9x$$

$$-4x=10$$

$$x=\frac{10}{-4}=-\frac{5}{2}$$

Doing this for the denominator yields a different value of x:

$$2(1-x)=6$$

$$2-2x=6$$

$$-2x=4$$

$$x=-2$$

Why is that I'm obtaining two different values of x? Further to this, the solution in the book states the answer as $x=-3$, what am I doing wrong?

Solve the equation $\frac{{3}^{5x+2}}{{9}^{1-x}}=\frac{{27}^{4+3x}}{729}$

I thought that the best way of approaching this would be to rewrite everything using 3 as the base of the exponents, hence creating an equivalence which would allow me to equate numerators to numerators, and denominators to denominators. Doing this yields:

$$\frac{{3}^{5x+2}}{{3}^{2(1-x)}}=\frac{{3}^{3(4+3x)}}{{3}^{6}}$$

Equating the exponents of each numerator:

$$5x+2=3(4+3x)$$

$$5x+2=12+9x$$

$$-4x=10$$

$$x=\frac{10}{-4}=-\frac{5}{2}$$

Doing this for the denominator yields a different value of x:

$$2(1-x)=6$$

$$2-2x=6$$

$$-2x=4$$

$$x=-2$$

Why is that I'm obtaining two different values of x? Further to this, the solution in the book states the answer as $x=-3$, what am I doing wrong?