Holomorphic functions on the singular locus unique liftable The example I would like to discuss in this question is introduced by Moret-Bailly in a MO question serving an example of a non-algebraic singularity:

Let $U\subset \mathbb{C}$ be open. Choose two holomorphic functions $f$, $g$ which are algebraically independent over $\mathbb{C}$ (e.g. $f(z)=z$, $g(z)=e^z$). For simplicity, assume that $f$, $g$, $0$, $1$ never coincide (pairwise) on $U$. Now define $X\subset U\times\mathbb{C}^2$ (with coordinates $z$, $x$, $y$) as the union of $x=0$, $y=0$, $x=y$, $y=f(z)\,x$, and $y=g(z)\,x$. Thus, if we freeze $z$, we get five lines in the plane, with slopes $\infty$, $0$, $1$, $f(z)$ and $g(z)$. Globally, $X$ is the union of five copies of $U\times\mathbb{C}$ meeting along $Z:=U\times\mathbb{0}$.
Now, the point is that the cross-ratio of four (ordered) lines through the origin in the plane is an intrinsically defined invariant. In particular, independently of the coordinates, we can recover $f$ and $g$ as holomorphic functions on the singular locus $Z$. If $X$ were isomorphic to a complex open subset of an algebraic variety, $f$ and $g$ would have to be algebraically dependent because $\dim Z=1$: contradiction.

Let $f \vert _Z,g \vert _Z$ the restrictions of $f \vert _X,g \vert _X$. Questions:
Q#1: Can $f \vert _X,g \vert _X$ be fully recovered from the restrictions to singular locus $f \vert _Z,g \vert _Z$?
From theory of Riemann surfaces I know that a theorem states that under certain conditions for a closed  $Y  \subset X$ with $\text{codim}(Y,X) >2$, homomorphic functions , which are defined on $X \backslash Y$, can be extended to $X$. problems: $X$ is not a manifold and the codimension condition for $X \backslash Z$ fails also.
We come to the main motivation : I want to understand that $f \vert _X,g \vert _X \in H^0(\mathcal{O}_X^{hol},X)$ are linearly dependent over $\mathbb{C}$. If we can prove, that Q_1 is true, then it suffice to show that the restrictions $f \vert _Z,g \vert _Z \in H^0(\mathcal{O}_Z^{hol},Z)$ are linearly dependent. Thus:
Q#2: Why are $f \vert _Z,g \vert _Z \in H^0(\mathcal{O}_Z^{hol},Z)$ linearly dependent? We know by construction that $\dim(Z)=1$, but I do not know how this implies that $\dim_{\mathbb{C}}H^0(\mathcal{O}_Z^{hol},Z)=1$. Problem is, since $Z$ is not compact, nor a manifold, the maximum principle isn't applicable.
At this point, I would like to admit that I'm an absolute newbie in complex geometry and possibly I did some mistakes trying to rephrase the example in my own words.
 A: Let's start with Q2. The statement is not that $f,g$ are linearly dependent in $H^0(\mathcal{O}_Z^{hol},Z)$, but that they would be algebraically dependent. This means that there's some nonzero polynomial $p$ in two variables so that $p(f,g)=0$. This is a generalization of linear dependence, in that any elements which are linearly dependent are also algebraically dependent.
Let's dig in to why $f,g$ as specified must be dependent if $X$ were some complex open subset of an algebraic variety. First, it is clear that any two functions on an integral 1-dimensional scheme must be algebraically dependent: if not, then their images in the fraction field would again be algebraically independent, which would mean that the fraction field is of transcendence degree $2$, contradicting the fact that the scheme is of dimension $1$. This claim generalizes quickly to the non-integral case. Next, if $X$ were isomorphic to a complex open subset of an algebraic variety, this would mean that $f,g$ were the restrictions of some algebraic functions $f',g'$ to $X$ - but then $f'$ and $g'$ satisfy some algebraic dependence relation, which $f$ and $g$ must also satisfy. So if $f,g$ aren't algebraically dependent (per our assumption), then $X$ can't be isomorphic to any complex open subset of an algebraic variety.
Now that that's out of the way, let's return to Q1. You have a pretty significant misunderstanding here: the example is not saying that we're recovering $f|_X$ and $g|_X$ from the data of $f|_Z,g|_Z$. Rather, what's going on is that we're showing that given the data of the five lines at some fixed coordinate $z=z_0$, we can figure out what $f(z_0)$ and $g(z_0)$ are, and this task may be accomplished in a way that does not depend on the coordinates used. The ordered cross-ration of the lines with slope $0,1,\infty,f$ and $0,1,\infty,g$ will be preserved under any change of coordinates and this cross ratio uniquely specifies the line with slope $f$ (resp. slope $g$). This is what the cross-ratio being an intrinsically defined invariant means. So this means that the values of $f,g$ on $Z$ may be deduced only from the geometric information present in $X$ - in particular, the values of $f,g$ we determine on $Z$ would be invariant under isomorphisms: we would get the same values of $f,g$ even if we found an isomorphism of $X$ with some complex open subset of an algebraic variety.
