Splitting a trivial bundle over punctured $\mathbb C^n$

The decomposition $\mathscr E|_U = V_1 \oplus V_2$ gives projectors $\pi_i \colon \mathscr E|_U \to \mathscr E|_U$ such that $\operatorname{im}(\pi_i) = V_i$. By Hartog's lemma, the restriction $\Gamma(X,\mathscr End(\mathscr E)) \to \Gamma(U,\mathscr End(\mathscr E))$ is a ring isomorphism, so $\pi_i$ extend to projectors $\mathscr E \to \mathscr E$ with $\pi_1 + \pi_2 = 1$, which gives a decomposition of $\mathscr E$ restricting to the given one on $\mathscr E|_U$. $\square$


Let $S$ be a normal Noetherian scheme, let $U$ be an open subset whose complement has codimension at least $2$, and let $j : U \to S$ be the inclusion. By e.g. SP Tag 0EBJ, the restriction and pushforward define an equivalence of categories between reflexive coherent $\mathcal{O}_{U}$-modules and reflexive coherent $\mathcal{O}_{S}$-modules. Thus the restriction maps $\operatorname{Hom}_{\mathcal{O}_{S}}(j_{\ast}V_{i},E) \to \operatorname{Hom}_{\mathcal{O}_{U}}(V_{i},E|_{U})$ and $\operatorname{Hom}_{\mathcal{O}_{S}}(E,j_{\ast}V_{i}) \to \operatorname{Hom}_{\mathcal{O}_{U}}(E|_{U},V_{i})$ are isomorphisms; we're given two maps $f_{i} : V_{i} \to E|_{U}$ and $\pi_{i} : E|_{U} \to V_{i}$ on $U$ whose composition $\pi_{i}f_{i}$ is the identity $\operatorname{id}_{V_{i}}$ so their (unique) lifts $j_{\ast}V_{i} \to E$ and $E \to j_{\ast}V_{i}$ to $S$ also compose to the identity $\operatorname{id}_{j_{\ast}V_{i}}$. The $j_{\ast}V_{i}$ are direct summands of a vector bundle, hence are vector bundles themselves.

(I think the example in the other answer had the property that $V_{1} \oplus V_{2}$ and $E|_{U}$ are locally isomorphic on $U$, but not globally.)