Maximum principle tells us that the maximum point will be on either t=0, x= lower limit (in this case, -2), x = higher limit (in this case 2). But from Yunheng's answer we can see the maximum point is indeed $(x,t) = (-1,1)$, not what the principle asserts.

The failure of the principle rooted in the possible negative value of $x$. A crucial step of the proof needs

\begin{equation}\label{eq:1}

v_t - kv_{xx} <0

\end{equation}

and the for the imaginary inner max point $(x_0,t_0)$,

\begin{equation} \label{eq:2}

v_t(x_0,t_0) - kv_{xx}(x_0,t_0) \ge 0

\end{equation}

to arrive at a contradiction. Where $v(x,t) = u(x,t) + \epsilon x^2$.

We can see in this example $k$ is changed to $x$, which is not a fixed positive value anymore, it has a chance of getting negative to fail both of these two equations. (Of course in the specific example t=1 is on the upper boundary, the second equation is proved differently than an inner point, but we nevertheless will arrive at (\ref{eq:2}) for contradiction purpose. Furthermore possible failure in (\ref{eq:1}) suffices.)