CFDI40159

La clave del campo RegimenFiscalR no corresponde de acuerdo al RFC del receptor (…).

In English With a generic RFC (XAXX010101000 or XEXX010101000), RegimenFiscalReceptor must be 616 (no tax obligations).

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Context
/cfdi:Comprobante/cfdi:Receptor
Test
not($generic) or @RegimenFiscalReceptor = '616'

Checked with CFDI 4.0