Counterexamples to the avoidance lemma for arbitrary ideals
As a simple source of counterexamples, let $A$ be any finite ring that is not a principal ideal ring. Then for any nonprincipal ideal $I\subset A$, $I$ is the union of the (finitely many) principal ideals generated by the elements of $I$, but it is not contained in any single such principal ideal. A concrete example of such a ring is $A=k[x,y]/(x^2,xy,y^2)$ for any finite field $k$, with $I=(x,y)$.