Short answer. Yes. Article 56 requires denial of a legal separation petition where both parties have given ground for legal separation. If both spouses are guilty of conduct that would otherwise justify the decree, the court must deny the petition on that basis alone.
What the law says
The petition for legal separation shall be denied on any of the following grounds: (1) Where the aggrieved party has condoned the offense or act complained of; (2) Where the aggrieved party has consented to the commission of the offense or act complained of; (3) Where there is connivance between the parties in the commission of the offense or act constituting the ground for legal separation; (4) Where both parties have given ground for legal separation
Family Code, Article 56 — Grounds for Denying Legal Separation. Read the full provision →
Mutual guilt is an express, mandatory ground for denial
Article 56 lists specific circumstances that require a court to deny a legal separation petition, and your situation is covered directly. The article provides that the petition "shall be denied" where "both parties have given ground for legal separation." This is item four in the list, and the word "shall" signals that denial on this ground is mandatory once it is established, not something left to the court's discretion.
Why the law does not let a guilty spouse also be an aggrieved one
Legal separation is built around the idea of an innocent spouse seeking relief from an offending one. When both spouses have engaged in conduct that would independently justify a decree, neither can credibly occupy the position of the wronged, aggrieved party the law is designed to protect. Denying the petition in this situation reflects that the remedy exists for someone who comes to court with, in a sense, clean hands relative to the other spouse — not for two spouses equally responsible for similar breakdowns in the marriage.
This ground for denial exists alongside several related ones
Mutual guilt is only one of the mandatory grounds for denial in the same article. The list also requires denial where "the aggrieved party has condoned the offense or act complained of," where "the aggrieved party has consented to the commission of the offense," and where there is "connivance between the parties in the commission of the offense." These grounds share a common thread: each one, in a different way, undermines the picture of one truly innocent spouse seeking separation from a truly offending one.
What this means if both spouses have separate grievances
If you are considering filing for legal separation, be aware that your own conduct during the marriage is not irrelevant simply because you are the one bringing the petition. If your spouse can show that you, too, engaged in conduct that would independently support a legal separation, the court is required to deny the petition on that basis regardless of how serious your spouse's own misconduct may have been. This makes an honest assessment of both spouses' conduct an important part of evaluating whether a legal separation petition is likely to succeed.