Short answer. Yes. Article 1422 provides that a contract which is the direct result of a previous illegal contract is also void and inexistent. Because your new contract directly resulted from the earlier illegal one, its own validity is not saved by being a separate, later document.
What the law says
A contract which is the direct result of a previous illegal contract, is also void and inexistent.
Civil Code, Article 1422 — A Contract That Is the Fruit of an Earlier Illegal Contract. Read the full provision →
Illegality carries through to what it directly produces
Article 1422 states the rule without qualification: a contract which is the direct result of a previous illegal contract, is also void and inexistent. Signing a new, separate document does not, by itself, wash away the illegality that tainted the arrangement that produced it. If your second contract exists specifically because of, and as a direct consequence of, the earlier illegal one, the law treats it the same way it treats the contract it sprang from: void and inexistent, as though it never had legal effect at all.
Why the law looks past the form of a later, separate document
The law is concerned with substance here, not merely with how many documents were signed or how much time passed between them. Allowing parties to launder an illegal arrangement into something enforceable simply by drafting a fresh contract that carries out or depends on the illegal one would defeat the entire purpose of declaring the original contract void. Article 1422 closes that door by extending the same fate to whatever contract is the direct result of the illegal one, rather than treating each document as a fresh, independent transaction.
What 'direct result' means for your situation
The key phrase is 'direct result'. A contract that merely happens to exist alongside, or at some point after, an illegal one is not automatically swept into this rule; what matters is whether the second contract exists specifically because of, and as a consequence flowing from, the earlier illegal contract. If your new contract was created to implement, complete, or otherwise carry forward what the illegal contract set in motion, that direct connection is what brings it within Article 1422's reach.
What this means for enforcing the new contract
Because the new contract is treated as void and inexistent, neither party can rely on it to enforce obligations or claim rights as though it were a valid agreement. This applies regardless of how carefully the second contract was drafted or how clearly both parties intended to be bound by it, since the defect traces back to the illegal origin itself rather than to anything wrong with the second contract's own drafting or wording.