There doesn't appear to be a way for tools built around createrepo_c to correctly handle this issue.
I would consider one of these to be valid solutions:
Do not generate the metadata after going through all the packages and returning the error for tools/people to handle. In this case, there would be no metadata for anything to consume because createrepo_c wouldn't make any as long as there are errors in the package data.
Add them in anyway, but add some kind of tag indicating that it's a badly written package, and corrections are required. Some repodata validation tool could handle this and return the information appropriately. Likewise, DNF could have code written to handle detection of this particular tag and deal with it differently.
We cannot allow broken dependency chains to exist, in any form.