# Obstruction Theory: extending a map on CW complexes

I'm trying to read about obstruction theory from Davis & Kirk and trying to find a map $g \colon X_n \rightarrow Y$ from the $n$-skeleton of a relative CW complex $(X,A)$ to a path-connected $n$-simple space $Y$ such that the obstruction cocycle $\theta^{n+1}(g)$ is nonzero but the class $[\theta^{n+1}(g)]$ is zero. Equivalently, I'd like to find a map $g$ so that $g$ does not extend to $X_{n+1}$ but $g|_{X_{n-1}}$ does.

Are there any simple examples of this? I was thinking about maybe using odd-dimensional $\mathbb{R}\mathrm{P}^n$, but I can't seem to figure anything out...

Let $(X,A) = (D^2, \emptyset)$, and let $Y = S^1$. Let $g: X_1 = S^1 \to Y = S^1$ be any nontrivial map, e.g., the identity. Then $\theta(g) \neq 0$ (by definition of nontrivial!), and is in fact the degree of the map $g$, since the attaching map of the $2$-cell of $D^2$ is the identity map.
But $[\theta(g)] = 0$ since a fortiori $H^2(D^2;\pi_1 S^1) = 0$. Alternatively, the $0$-skeleton of $X$ is just a point $\{*\}$, and clearly $g|_{\{*\}}$ extends to a map $\tilde{g}: D^2 \to S^1$, e.g., the constant map at $g(*)$.