Yes, an agreement might undo community property.
One would evaluate whether the agreement truly separates the property and, if so, whether the agreement is legally enforceable.
In doing that analysis, one might consider the internal law, and conflict-of-laws law, of each jurisdiction that might have some connection to the situation, including:
the State of company A’s organization or formation,
the State in which the first community-property interest was created,
each State in which there was (or might have been) an addition to community property,
each State in which there was insufficient accounting between separate and community property,
the domicile of each spouse,
the residence of each spouse,
the State in which each spouse signed the agreement,
the State law the agreement specifies as governing the agreement, and
the State law that governs the agreement.
A practitioner would want to fact-check the situation with no less care than Circular 230 calls for.
Before pursuing an agreement, each spouse should consider the consequences, including for property ownership, income taxes, estate planning, and estate and inheritance taxes.
Under some States’ laws, an agreement might be invalid unless each spouse has separate counsel. Even when that’s not a State-law condition, S. Derrin Watson in Who’s the Employer? (1998) suggested: “Such an agreement should not even be considered unless husband and wife are separately represented by experienced counsel, even in a friendly situation.” The American College of Trust and Estate Counsel’s Commentaries on the Model Rules of Professional Conduct describes more nuanced views.