Let us consider a Hilbert space $\mathbb{R}^{n}$ equipped with a dot product $x\cdot y = \sum_{i=1}^{n}x_{i}y_{i}$. Next, let $S$ be a convex closed subset of $\mathbb{R}^{n}$ and let $s$ be a projection of $x$ onto $S$.
First, from the property of orthogonal projection, it follows that $$ \sum_{i=1}^{n}x_{i}s_{i} = \sum_{i=1}^{n}s_{i}s_{i} $$
Next, let $y$ be some vector from $S$. What is the relation between $\sum_{i=1}^{n}x_{i}y_{i}$ and $\sum_{i=1}^{n}s_{i}y_{i}$?
Is it always $$ \sum_{i=1}^{n}x_{i}y_{i} \leq \sum_{i=1}^{n}s_{i}y_{i} $$ ?
The difference in the two terms you are trying to compare is $$ (x - s) \cdot y = \sum_{i=1}^n (x_i - s_i) y_i $$ If $x = s$ (that is, if $x \in S$), then it is always zero and the two terms are always equal. If they are different, this can have any value by varying $y$. It can be positive by setting $y = x - s$ or it can be negative by setting $y = -(x - s)$.