Here is an example with CW complexes rather than simplicial complexes. I doubt that there is an important difference, although the simplicial case will require more bookkeeping. Take $K=\mathbb{R}P^3$ and $Y=\mathbb{R}P^2$. We can give $K$ a CW structure with skeleta $\mathbb{R}P^k$ for $0\leq k\leq 3$. Let $f^1:\mathbb{R}P^1\to Y$ be the evident inclusion. Clearly this extends over $K^2$. Any extension $f^3:K^3=K\to Y$ of $f^1$ would be nontrivial on $H^1(Y;\mathbb{Z}/2)$, but this is impossible because the generator of $H^1(Y;\mathbb{Z}/2)$ cubes to zero, but the generator of $H^1(K;\mathbb{Z}/2)$ does not.