It looks like the formula $\gcd(a,b) \cdot \mathrm{lcm}(a,b) \sim a \cdot b$ works for any cyclic ring or rng:
$\gcd \cdot \mathrm{lcm}$ for cyclic rings
I am looking for an example of a commutative ring or rng where the formula is not working.
Let's redefine associates $(\sim)$ as elements that generate the same principal ideal for the task.
This definition is equivalent for commutative rings, but weaker for rngs.
Update
Let's define a Prüfer ring/rng as a ring/rng where $(A + B) \cdot (A \cap B) = A \cdot B$
for any ideals $A$ and $B$.
Let's use the example with $\mathbb Z[x]$ from here:
https://math.stackexchange.com/a/58358/427611
Taking $A = (2)$ and $B = (x)$;
$A \cdot B = (2) \cdot (x)$ contains element $2x$;
$(A + B) \cdot (A \cap B) = ((2) + (x)) \cdot ((2) \cap (x))$ does not contain $2x$;
Therefore, $(A + B) \cdot (A \cap B) \ne A \cdot B$.
Thus, $\mathbb Z[x]$ is not a Prüfer ring,
and the $\rm gcd \cdot lcm$ formula should not work for $A = (2)$ and $B = (x)$.
However,
$\gcd(2, x) = 1$;
$\mathrm{lcm}(2, x) = 2x$;
$\gcd(2, x) \cdot \mathrm{lcm}(2, x) = 2x = 2 \cdot x$.
The $\gcd \cdot \mathrm{lcm}$ formula works for $A = (2)$ and $B = (x)$!
Thus, not being a Prüfer ring is not sufficient to break the $\rm gcd \cdot lcm$ law.
Is this correct?