Let $C$ be the (smooth) curve in $\mathbb{C}^2$ defined by $y^2 = x^4 - 1$, and let $\pi : C \to \mathbb{C}$, $\pi(x,y) = x$. $\pi$ is a ramified cover, ramified over $\pm 1, \pm i$.
$C$ is a non-compact Riemann surface; there is a canonical way to make it a compact RS via $\pi$ by adding "missing" points, here the points over $\pm 1, \pm i$ and $\infty$. If I understand things correctly, this is the same as considering the projective curve $X$ in $\mathbb{P}^2\mathbb{C}$ defined by $y^2z^2 = x^4 - z^4$. This yields a single point at infinity $[0:1:0]$. We can extend $\pi$ as a ramified covering of $\mathbb{P}^1\mathbb{C}$ of degree two, ramifying over $\pm 1, \pm i$ and $\infty$ with ramification index 2 (all of these points have a single antecedent instead of two).
Applying the Riemann-Hurwitz formula, we finally get $2-2g = 4 - (1+1+1+1+1) = -1$, which is obviously wrong. I know the result of compactifying $C$ is supposed to be an elliptic curve, of genus 1, and that the projection should not ramify over infinity, but I can't figure out where I went wrong.
What's strange is, if I started with $C = \{ y^2 = x^3 - 1 \}$ (also an elliptic curve of genus 1), I also get a single point at infinity, and the end result is "right". So where does my method go wrong?