Per IRS instructions for Form 2441 Child and Dependent Care Expenses, page 4:
CAUTION! You must reduce your earned income by any loss from self-employment.
This refers to the amount of earned income reported for the taxpayer and spouse on lines 4 and 5 of Form 2441. Due to these instructions, the taxpayer (or spouse on a joint return) must reduce his/her individual income by the amount of their self-employment loss. This may result in the return not being eligible for the credit as both must have earned income as explained on page 2 of the form instructions:
Who Can Take the Credit or Exclude Dependent Care Benefits?
You can take the credit or the exclusion if all five of the following apply.