Let be $(g,\omega)$ the Weierstrass data of a immersion $X: \Sigma\to \mathbb{R}^3$, i.e., $g$ a meromorphic function and $\omega$ a holomorphic 1-form such that $$X=\mathcal{Re}\int_\gamma (\frac{1}{2}(1-g^2)\omega,\frac{i}{2}(1+g^2)\omega,g\omega).$$ Suppose that, away from of critical point of height function $x_3$ there is a local complex coordinate $w$ such that $x_3=\mathcal{Re}(w)$, that is, $$\mathcal{Re}(\int_\gamma g\omega)=\mathcal{Re}(w).$$
Under what conditions I have that $$g\omega= dw?$$
Locally around a point $p$, write $\omega = m (z) dz$ and $dw = w'(z) dz$. Then your equation $g \omega = dw$ is equivalent to \begin{equation} g(z) m(z) = w'(z).\end{equation} Since $p$ is not a critical point, we have that $w'(z) \neq 0$. Hence, you require either that (1) $g$ and $\omega$ are nonzero at $p$ or (2) the order of the pole of $g$ at $p$ is equal to the order of the zero of $\omega$ at $p$.
Note that since $X$ is an immersion, if $\omega$ has a zero of order $2m$ at $p$, then $g$ must have a pole of order at most $m$ at $p$. In particular, (2) is never satisfied.
So you must have that $g$ and $\omega$ be nonzero at $p$.