The set $L_n$ (using the notation from that answer you quoted) is not connected and the (open) neighbourhood of $L_n$ is explicitly also not connected, therefore the identity theorem (for which I gave the link in a comment) doesn't apply. If it was connected, you could not argue like in that answer. To illustrate this, consider for example the following function:$$f \colon z \longmapsto \begin{cases}e^{z} & \text{for } z \in B_1 (0)\\0 & \text{for } z \in B_1 (1)\end{cases}$$Now $f$ is holomorphic (because it is complex-differentiable everywhere it is defined) on an open subset of $\mathbb C$ $\big(\text{namely }B_1(0) \cup B_1 (1)\big)$ and it is constant on an open subset. But you can't infer, that $f$ is constant everywhere and there is no reason why it should be.
The identity therorem doesn't apply here, because the domain where $f$ is defined is not connected. If you have a connected, open subset of $\mathbb C$ the behaviour of a holomorphic function on any open disc, no matter how small, determines the function everywhere on that connected set. If the function is defined on a set which is not connected, then the parts don't have to have anything to do with each other at all (as you can see in my example above).
That is also why most of function theory is done and formulated for open, connected subsets of $\mathbb C$, i.e. domains.