TITLE: Is a locally finite union of $G_\delta$-sets a $G_\delta$-set?
QUESTION [11 upvotes]: Problem. Let $\mathcal F$ be a locally finite (or even discrete) family of (closed) $G_\delta$-sets in a topological space $X$. Is the union $\cup\mathcal F$ a $G_\delta$-set in $X$?
Remark. The answer to this problem is affirmative in perfect spaces.
A topological space $X$ is perfect if each open subset of $X$ can be written as the countable union of closed sets. I suspect that in general topological spaces a counterexample should exist but I cannot find it, unfortunately.

Added in Edit. This question has a counterexample "living" in a second-countable Hausdorff space, which is not regular. So, it remains to find a (completely) regular example.

Added in a Next Edit. A regular counterexample was constructed by Mathieu Baillif in his answer to this question.

REPLY [3 votes]: I found a simple counterexample, which is however not regular.

Example. There exists a functionally Hausdorff second-countable space $X$ containing a closed discrete subset $D$, which is not of type $G_\delta$ in $X$.
In this space the countable the family of singleton $\mathcal F=\{\{x\}:x\in D\}$ is a locally finite family of closed $G_\delta$-set whose union $\cup\mathcal F=D$ is not a $G_\delta$-set in $X$.

Proof. Let $X$ be the real line endowed with the topology $\tau$ consisting of sets $W\subset \mathbb R$ such that for each point $w\in W$ there exists $\varepsilon>0$ such that each point $x\in\mathbb R\setminus \mathbb Q$ with $|x-w|<\varepsilon$ belongs to $W$. It is easy to see that the topological space $X$ is second-countable and functionally Hausdorff but not regular.
The definition of the topology $\tau$ ensures that the countable set $D:=\mathbb Q$ of rational numbers is closed and discrete in $X$. We claim that $D$ is not a $G_\delta$-set in $X$. To derive a contradiction, assume that $D=\bigcap_{n\in\omega}W_n$ for some decreasing sequence $(W_n)_{n\in\omega}$ of open sets in $X$. By the definition of the topology $\tau$, for every $n\in\omega$ and $x\in W_n$ there exists an neighborhood $V_{n,x}$ of $x$ in the Euclidean topology of $\mathbb R$ such that $V_{n,x}\setminus D\subset W_n$. Then $V_n:=\bigcup_{w\in W_n}V_{n,x}$ is an open set such that $D\subset W_n\subset V_n$ and $V_n\setminus D=W_n\setminus D$, which implies that $V_n=D\cup (V_n\setminus D)=D\cup(W_n\setminus D)=W_n$. This means that each set $W_n$ is open in the Euclidean topology of the real line and the set of rational numbers $D=\bigcap_{n\in\omega}W_n$ is of type $G_\delta$ in $\mathbb R$, which contradicts the Baire Theorem.

Added in Edit. Answering this question, Mathieu Baillif constructed a first-countable zero-dimensional Hausdorff space $X$ of cardinality $|X|=\omega_1$ containing a closed discrete subset $D$, which is not a $G_\delta$-set in $X$. Then $\mathcal F=\{\{x\}:x\in D\}$ is a locally finite family of compact $G_\delta$-sets
in $X$ whose union $\cup\mathcal F$ is not a $G_\delta$ in $X$.