Inclusion-Exclusion for Coherent Sheaves

Let $X$ be a (reduced) affine variety with two irreducible components, $X_1$ and $X_2$, and let $\mathcal{E}$ be a torsion-free coherent sheaf on $X$. Denote the pullbacks of $\mathcal{E}$ to the closed subvarieties $X_1$, $X_2$, and $X_1 \cap X_2$ by $\mathcal{E}_1$, $\mathcal{E}_2$, and $\mathcal{E}_{12}$, respectively. Then there is a short exact sequence in the category of coherent sheaves on $X$

$$0 \to \mathcal{E} \to \mathcal{E}_1 \oplus \mathcal{E}_2 \to \mathcal{E}_{12} \to 0$$

which gives rise to an "inclusion-exclusion" formula in the Grothendieck group of coherent sheaves on $X$

$$[\mathcal{E}] = [\mathcal{E}_1] + [\mathcal{E}_2] - [\mathcal{E}_{12}]$$

If we try to generalize this formula to affine varieties with more than two irreducible components, the induction gets stuck: the pullback of a torsion-free sheaf to a union of components might not remain torsion-free. Are there natural conditions on $\mathcal{E}$ (or perhaps the components of $X$) that guarantee a formula like this holds? Would it help if I told you that everything is equivariant (for a reductive group $G$) and each component of $X$ contains an open dense $G$-orbit?

Another way to say the same is the following. First, you can apply this construction to the structure sheaf of $X$ (by the way, the affinness assumption is absolutely irrelevant here). What you get is a complex, whose terms are sums of structure sheaves of intersections of components, and which is quasiisomorphic to $O_X$. Now you can tensor it with any sheaf on $X$ (or with any complex on $X$). You will get a spectral sequence, that will converge to the original object. However, unless the object is a perfect complex, the spectral sequence will be infinite, and will not give a direct expression for the class in the Grothendieck group.