Yes, a hypothesis is definitely missing. The usual proof requires that $Y$ have a countable $\pi$-base, i.e., a countable family $\mathscr{C}$ of non-empty open sets such that every non-empty open subset of $Y$ contains a member of $\mathscr{C}$; here’s an example showing that the result can fail in the absence of such a hypothesis.
Let $Y=[0,1]\times[0,1]$, and define a metric $d$ on $Y$ as follows:
$d\Big(\langle x,a\rangle,\langle y,b\rangle\Big)=\begin{cases} |x-y|,&\text{if }a=b\\ 2,&\text{if }a\ne b\;. \end{cases}$
It’s easy to check that $d$ is a complete metric. It will be convenient to let $Y_a=\{\langle x,a\rangle:x\in[0,1]\}$ for each $a\in[0,1]$; note that $Y_a$ is open in $Y$.
Let $X=[0,1]$ with the usual topology; $X\times Y$ is the disjoint union of the clopen subsets $X\times Y_a$ for $a\in[0,1]$, and each of these subsets is homeomorphic to $[0,1]\times[0,1]$ with the usual topology.
Now let
$O=\left\{\Big\langle x,\langle y,a\rangle\Big\rangle\in X\times Y:x\ne a\right\}\;.$
For each $a\in[0,1]$, $O\cap\Big(X\times Y_a\Big)$ is homeomorphic to $\Big([0,1]\setminus\{a\}\Big)\times[0,1]$ with the usual topology and therefore is dense and open in $X\times Y$, so $O$ itself is dense and open in $X\times Y$. But for each $x\in X$, $E_x=\{\langle y,a\rangle\in Y:a\ne x\}$, which is disjoint from $Y_x$ and therefore not dense in $Y$. That is, $\{x\in X:E_x\text{ is dense and open in }Y\}=\varnothing$.