Net::LDAP::Gateway contains a
sample LDAP server that can dump the packets it receives as almost-human-friendly Perl data structures. It has served me in the past to compare and validate requests made through
Net::LDAP and
ldapsearch and solve problems as the one you were facing.