Solution 1:

I think the reason the formula does not apply is that the singularity is not an "ordinary singularity of multiplicity r" (a.k.a. $r$ distinct lines crossing at a point).

From your second chart, we have a cusp at the origin, and if we blow it up (basically substitute $xz$ for $z$ and factor out an $x^2$ -- this is equivalent to enlarging the coordinate ring by adjoining $z/x$, which is integral over it), we're left with $$4 x^2 z^4-5 x^2 z^2+x^2-z^2=0$$ And the lowest degree part is $x^2 - z^2 = 0 = (x-z)(x+z)$, so locally the singularity is now ordinary of multiplicity 2. If this were the entire singularity, we would just be subtracting $1$, but since we also needed the function $z/x$ to resolve the cusp, we also subtract one more.

More details to justify the last part. For any smooth projective curve $C$, let $f: \tilde{C} \to C$ be the normalization. There is a short exact sequence

$0 \to \mathcal{O}_C \to f_*\mathcal{O}_{\tilde{C}} \to F \to 0$,

where $F$ is supported only along the singularities of $C$, and is a finite-length $\mathcal{O}_C$-module. Let its length be $\ell$. The cohomology gives

$0 \to H^0(\mathcal{F}) \to H^1(\mathcal{O}_C) \to H^1(f_*\mathcal{O}_{\tilde{C}}) \to 0$,

so in particular $g_a(C) + \ell = g(\tilde{C})$, where $g_a(C)$ means the arithmetic genus and $g(\tilde{C})$ is the geometric genus. So $\ell$ is basically "how many extra regular functions" the normalization has.

The claim is that $\ell = 2$. Resolving the cusp introduced $z/x$ to the coordinate ring. I think $z/x$ satisfies a quadratic polynomial (this is true at least locally, you can check that $$ (1-4z^2) (z/x)^2 + (5z^2 - x^2) = 0,$$ and since the leading coefficient doesn't vanish at the origin, this is as good as a monic polynomial.)

So we've only introduced one more function in this step. Then, the second step introduces the $\tfrac{1}{2}r(r-1) = 1$ additional function to separate the two lines.