Hi Pierangelo,
Try this patch:
ftp://ftp.openldap.org/incoming/pierangelo-masarati-2010-04-29-chain.1.patch
It removes the offending check. I don't quite remember the reason (it dates 4.5 years ago). However, I've checked and all tests pass fine, including the one you pointed out. To reproduce, I modified test022 to write the configuration on disk (-F option to consumer slapd); at the end of the test, I tried slapd on the resulting database. Fails with 2.4.22/HEAD, succeeds with this patch.
Please test and report.
p.
I just wanted to see if you'd had a chance to check into this yet? As mentioned in the last ITS response, your patch does fix the test script, but unfortunately, referrals are still not being automatically chased because the DN is not passed correctly upstream to the read/write master. Thoughts?