This will hold for CW structures on manifolds coming from [handle decompositions][1], e.g. induced by a [Morse function.][2] Complex line bundles on $X$ are classified by the homotopy class of maps to $\mathbb{CP}^{\infty}$, by pulling back the canonical line bundle $\gamma(\mathbb{CP}^\infty)$. Also, $\mathbb{CP}^\infty = K(\mathbb{Z},2)$, so $\pi_i(\mathbb{CP}^\infty)=0, i > 2$. Now, consider a line bundle $L$ on $X$ a manifold with a handle structure, such that $L$ is trivial on $X-Y$, where $Y$ is contained in the codimension 3-skeleton. Flipping the handle structure over (so that $k$-cells become $n-k$ cells), we get a handle structure on $X$ in which the line bundle is trivial on the $3$-skeleton (whose handles correspond dually to handles in $X-Y$). The line bundle $L$ is induced by a map $X\to \mathbb{CP}^\infty$ which is trivial on the $3$-skeleton, and hence may be homotoped to be constant on the 3-skeleton by homotopy extension. Then we may homotope each $i$-cell, $i>3$, to be trivial inductively using the fact that $\pi_i(\mathbb{CP}^\infty)=0$, until we have homotoped it to a trivial map. So at least this works for handle structures on manifolds. [1]: https://en.wikipedia.org/wiki/Handle_decomposition [2]: https://en.wikipedia.org/wiki/Handle_decomposition#Morse_theoretic_viewpoint