Why doesn't the Stone-Weierstrass theorem imply that every function has a power series expansion? I know that not every function has a power series expansion. 
Yet what I don't understand is that for every $C^{\infty}$ functions there is a sequence of polynomial $(P_n)$ such that $P_n$ converges uniformly to $f$. That's to say : 
$$\forall x \in [a,b], f(x) = \lim_{n \to \infty}  \sum_{k = 0}^{\infty} a_{k,n}x^k$$
But then because it converges uniformly why can't I say that : 
$$\forall x \in [a,b], f(x) =   \sum_{k = 0}^{\infty} \lim_{n \to \infty} a_{k,n}x^k$$
And so $f$ has a power series expansion with coefficients: $\lim_{n \to \infty} a_{k,n}x^k$. 

$$\lim_{n\to\infty}\left(\lim_{k\to\infty} a_{n,k}\right)$$ is, in general, not the same as $$\lim_{k\to\infty}\left(\lim_{n\to\infty} a_{n,k}\right)$$
and in order to switch the order of your infinite sum (which is in its definition a limit) and your limit, you would need something like that.
