The answer at the linked question is indeed incorrect. We get a counterexample in $\mathbb{R}^3$ (that generalises of course to Hilbert spaces of arbitrary dimension $\geqslant 3$) by taking $X = \operatorname{span} \{ e_1\}$ and $Y = \operatorname{span} \{ e_1 + e_3, e_2\}$. Then $X\cap Y = \{0\}$ and $X^{\perp} \cap Y = \operatorname{span} \{e_2\} \neq Y$.
In a Hilbert space, we can look at the orthogonal projection $P$ onto $X$. Since $\dim Y > \dim X$, it follows that $P\lvert_Y$ cannot be injective, hence
$$Y \cap X^{\perp} = \ker (P\lvert_Y) \neq \{0\}.$$
We can generalise this to complemented subspaces (every finite-dimensional subspace of a normed space is complemented) $X$ of Banach spaces $B$: If $C$ is a complementary (closed) subspace to $X$, then the canonical projection $\pi \colon B \to B/C$ cannot be injective on $Y$ if $\dim Y > \dim B/C = \dim X$, so $Y\cap C \neq \{0\}$.
Of course we can forget about everything topological and use an algebraic complement (which always exists thanks to the axiom of choice) to reach the same conclusion, but in functional analysis, algebraic complements are typically not useful, while topological complements are.