https://bugs.openldap.org/show_bug.cgi?id=10060
--- Comment #3 from Ondřej Kuzník ondra@mistotebe.net --- Hi David, thanks for the report.
You are correct, while the ldap_result manpage doesn't specify whether either behaviour is correct, the C LDAP API draft[0] is quite explicit about the result being "the type of the first result returned in the res parameter."
On the other hand, ldapsearch depends on the current behaviour so it might need updating in lockstep.
[0]. https://datatracker.ietf.org/doc/html/draft-ietf-ldapext-ldap-c-api-05#secti...