Let $A$ be a compact self-adjoint operator on an infinite-dimensional Hilbert space H. Suppose $(\lambda_n)$ is a sequence of different eigenvalues of $A$ and $(x_n)$ is a sequence of corresponding eigenvectors with $\| x_n \| = 1$.
Is the set $S = \{ \sum_{i=1}^{\infty} \alpha_nx_n\ : \alpha_n \in \mathbb{C}, \ \sum_{i=1}^{\infty} | \alpha_n |^2 < \infty \}$ closed?
I know that self-adjoint operators are closed. If $(y_n)$ is a sequence in $S$ converging in $H$, say to $y$. Then, due to compactness of $A$, the sequence $(Ay_n)$ converges to $Ay$. Since $A$ is closed $y \in S$. But I am not sure if this is a correct proof.
The reason why $S $ is closed is that the sequence $\{x_n\} $ is orthonormal (this follows from $A $ selfadjoint).
In your reasoning, if $y_n\to y $ then $Ay_n\to y $ because $A $ is bounded; compactness has nothing to do with it. And the "$A $ is closed" bit is nonsense; there are selfadjoint compact operators with dense range (typical example ism $A $ that maps the canonical basis by $e_n\mapsto e_n/n $.