Well-definedness of first obstruction (to extending a map or homotopy of maps over the skeleta of a CW complex) lying in a nonzero group

Let $X,Y$ be CW complexes and suppose for simplicity that $Y$ is simply connected.

There is an obstruction $O(f_n)$ to extending a map of CW complexes $f_n:X^n\to Y$ defined only on the $n$-skeleton $X^n$ of $X$, to a map $f_{n+1}:X^{n+1}\to Y$, and this obstruction lives in $H^{n+1}(X;\pi_n(Y))$. The precise statement is that there exists an extension of $f_n|_{X^{n-1}}$ to $f_{n+1}$ if and only if $O(f_n)=0$.

Similarly, given two maps $f,g:X\to Y$, there is an obstruction $O(f,g,H_n)$ to extending a homotopy $H_n:X^n\times I\to Y$ between $f|_{X^n}$ and $g|_{X^n}$ to a homotopy $H_{n+1}:X^{n+1}\times I\to Y$ between $f_{X^{n+1}}$ and $g|_{X^{n+1}}$, and this obstruction lives in $H^{n+1}(X; \pi_{n+1}(Y))$. This second fact is actually a special case of (the relative version of) the first fact.

My question is to prove (or disprove!) the following claim, left explicitly as an exercise, in the book "Rational Homotopy Theory and Differential Forms" by Griffiths and Morgan:

Fix $f,g:X\to Y$ and suppose $H^i(X;\pi_i(Y))=0$ for $i\leq n$, so that by the above we can inductively construct a (not necessarily unique!) homotopy $H_n:X_n\times I\to Y$. Then $O(f,g,H_n)\in H^{n+1}(X;\pi_{n+1}(Y))$ is independent of the choice of homotopy $H_n$. This is often phrased as the statement "the first obstruction lying in a non-zero group is well defined".

I am aware of a proof of this result (in fact of a version of this result for the more general case of extending maps, from which this result follows) but under the stronger hypothesis that the actual coefficient groups vanish: $\pi_i(Y)=0$ for $i\leq n$. However, this proof relies strongly on this extra hypothesis and provides little insight into how to proceed without it.
As well, the analogous claim for the more general case of extending maps is clearly untrue without some additional hypothesis, because we could always choose the map $f_n:X^n\to Y$ to be a map to a point, which would of course have vanishing obstruction $O(f_n)$, and if the obstruction were independent of this choice then this would imply the obstruction always vanished!