Given $f \in C^{n+1}([a,b])$ and a set of $n+1$ points in $[a,b]$. And given $P$ the Lagrange interpolation polynomial, the error function is $f - P = \frac{f^{(n+1)}(\eta_x)}{(n+1)!}w_S(x)$ where $w_S(x) = \Pi (x-x_i)$, $x_i$ are the nodes of interpolation and $\frac{f^{(n+1)}(\eta_x)}{(n+1)!}$ is just a constant so the overall error function is a polynomial.
This all means that $f = P + \frac{f^{(n+1)}(\eta_x)}{(n+1)!}w_S(x)$.
The right hand side is a polynomial, so $f$ is a polynomial but this is not always true. What's the problem with this?
The right hand side is not in general a polynomial... $f^{(n+1)}(\eta_x)$ is a function of $x$. Think, for simplicity, that $f(x)=e^x$. Then we have that $$ f(x)=p_n(x) + \frac{e^{\eta(x)}}{(n+1)!} \prod_{i=0}^n (x-x_i). $$
The function $e^{\eta(x)}$ is then defined by $$ e^{\eta(x)} = (n+1)!\dfrac{f(x)-p_n(x)}{\prod_{i=0}^n(x-x_i)}. $$
So, not a polynomial (in general).