I think it's best to illustrate this with an example.
Take for instance the ring of integers modulo $6$. If I have the system of equations:
$$ \begin{aligned} 2x + 2y &= 4 \\ 3x + 4y &= 3 \end{aligned} $$
I divide the first equation by $2$:
$$ \begin{aligned} x + y &= 2 \\ 3x + 4y &= 3 \end{aligned} $$
Subtract $3$ times the first equation from the 2nd equation to arrive at a solution for $y$:
$$ \begin{aligned} x + y &= 2 \\ 0 + y &= 3 \end{aligned} $$
Thus, $y = 3$ and $x = 5$.
From my understanding, this should be not possible as in ${\Bbb Z}_6$ there is no equivalence to $\frac12$ as $2$ does not have a multiplicative inverse in this ring, but yet I get a solution that works.
The best answer I have is that this is just a particular example in which dividing by $2$ was possible from construction, even if it makes no sense in the ring. I know I can invent situations where this would not be possible, for instance, if equation 1 was:
$$ 1x +3y = 1 $$
I'm curious if there is anything else at play here, or if it's just luck of construction that an answer could be found.
It's clearer triangularized: by (fraction-free) Gaussian elimination the system is equivalent to
$$\begin{align} x\ &=\ 5\\ 2y\ &= -6\end{align}\qquad$$
But $\,2y \equiv -6 \equiv 0 \pmod{\!6}\iff y \equiv 0\pmod{\!3}\iff y\equiv 0,3\pmod{\!6}\,$ by here.
Essentially you missed the solution $\,y\equiv 0\pmod{\!6}$ due to improper modular cancellation, i.e. not cancelling $\color{#c00}2$ everywhere (i.e. from the modulus too), as explained in the prior link, i.e.
$$\begin{align} \color{#c00}2y&\equiv \color{#c00}2\cdot 0\pmod{\color{#c00}2\cdot 3}\\ \iff\ y&\equiv\ \ \ \ \ 0\pmod{\ \ \ \ 3}\end{align}\qquad$$
or, divisibility-wise: $\,\color{#c00}2\cdot 3\mid \color{#c00}2y-\color{#c00}2\cdot 0\iff 3\mid y-0\,$ by cancelling $\color{#c00}2,\,$ i.e. $\,6\mid 2y\iff 3\mid y.$
Remark $ $ Generally your wrong inference is $\,nx\equiv na\pmod{\!nm}\iff x\equiv a\pmod{\!nm},\,$ but correct is $\,x\equiv a\pmod{\!m},\,$ so $\,\color{#0a0}{x\equiv\, a},\ a\!+\!m,\ a\!+\!2m,\ldots, a+(n\!-\!1)m\pmod{\!nm},\,$ so your wrong inference yields only one of the $\,n\,$ solutions $\!\bmod nm,\,$ viz. $\,\color{#0a0}{x\equiv a}\pmod{\!mn}$.
The "reason why it works" is that the direction $\,x\equiv a\pmod{\!mn}\,\Rightarrow\, nx\equiv na\pmod{\!mn}\,$ is always true. This multiplication (scaling) is a special case of the Congruence Product Rule. It's the cancellation in the opposite direction $(\Leftarrow)$ that fails without cancelling from the modulus too.