I am reading lemma 27.27.3 in stacks project.
In the proof it seems it seems to claim:
If $X$ is a scheme, where $f_1,\ldots, f_n \in \Gamma(X, O_X)$ generates the ring. Then $X= \bigcup X_{f_i}$ where $$ X_f:= \{x \in X \, : \, f_x \not= 0 \in O_{X,x} \}$$
How so? Suppose false, then pick $x$ not in the union. Then $$ 1_x =\sum (g_if_i)_x =0 \in O_{X,x} $$ But there is nothing wrong this either...
Your argument does not work since the stalks cannot be zero: They are local rings and the zero ring is not local. Therefore you reach a contradiction, which proves the claim.