Take $N=0$ and the piecewise linear function with $f(0)=f(2\pi)=1$ and $f(\frac{\pi}{2})=f(\frac{3\pi}{2})=-1$. Its graph looks like \__/.
The best uniform approximation by an element of $M$ is the $0$ function, but
$$
\hat{f}(0) = -\frac{1}{2}
$$
Actually the same idea works for any $N \in \Bbb N$. The function
$$
f(x) = \begin{cases}1 &\text{if} & x \in2\pi\Bbb Z\\-1& \text{else}\end{cases}
$$
is not continuous but can be approximated by functions $f_\epsilon$ of the type \__/ with $\|f-f_\epsilon\|_{L^1}\leq \epsilon$. In particular $|\widehat{f_\epsilon}(n)-\widehat{f}(n)| \leq \epsilon$ for any $n$ with
$$
\widehat{f}(n) = \begin{cases}-1 & \text{if}& n=0\\0 & \text{else}\end{cases}
$$
For $\epsilon$ small enough (for instance $\epsilon < 1/(2N+1)$), we have
$$
\|f_\epsilon - S_Nf\|_\infty \geq \|f_\epsilon - (-1)\|_\infty - 2(N+1)\epsilon) = 2 - (2N+1)\epsilon > 1= \|f_\epsilon - 0\|_\infty
$$
Of course, the $0$ function need not be the best uniform approximation of $f_\epsilon$ in $M$, but it is already better than the Fourier trigonometric polynomial.