Good morning. My question relates to civil procedure and res judicata.

Article 400 para 2 of the Ley de Enjuiciamiento Civil states: "a efectos de litispendencia y de cosa juzgada, los hechos y los fundamentos jurÃ*dicos aducidos en un litigio se considerarán los mismos que los alegados en otro juicio anterior si hubiesen podido alegarse en éste", which I understand to mean that legal grounds which could have been invoked in earlier proceedings (but were not invoked) are considered identical to legal grounds alleged in later proceedings, and thus precluded by res judicata (cosa juzgada).

As far as I understand it, this creates res judicata in scenario A below, but I’m not sure about scenario B. Are there any cases or scholarly writing addressing whether scenario B falls under Article 400 para 2?

Scenario A: The claimant based her claim on e.g. contractual liability but could also have based her claim on tort. She failed to invoke tort grounds and now the res judicata effect precludes her from bringing a new action based on those omitted grounds.

Scenario B: The defendant could have invoked the nullity of the contract against a contractual claim (cf. Article 408 paras 2-3), but did not do so. Is the defendant now precluded from ever invoking the nullity of the contract as a defence in later proceedings, e.g. if she is sued again for a different claim arising subsequently out of the same contract?

Any help would be greatly appreciated. Have a nice weekend.