roleSearch will be used for every group found.
Given your config and your groups/persons are as follows
dn: cn=group1,ou=...
cn: group1
uniqueMember: cn=person1,ou=...
dn: cn=group2,ou=...
cn: group2
uniqueMember: cn=group1,ou=...
dn: cn=person1,ou=...
cn: person1
mail: person1@...
When you log in as person1@... first thing the realm does is to look up dn for that person using mail=person1@...
It will get dn: cn=person1,ou=... as dn and will try roleSearch with {0} equal the newly found dn.
So the next lookup is uniqueMember=cn=person,ou=... which gives us cn=group1,ou=...
The attribute cn of that group will be stored as a role. Since nestedRoles is enabled it will now do a new search with roleSearch and the dn (and cn in your case).
The lookup will be uniqueMember=cn=group1,ou=... which will give us cn=group2,ou=... and again the cn (group2) will be stored.
So after that your user will have two roles (group1, group2).
It looks to me that the logic for nested roles is reverse to the one you expected.
If you want to get debug output, you can put the line org.apache.catalina.realm.JNDIRealm.level = FINE
at the end of your conf/logging.properties. The attribute debug in your realm definition is being ignored (and invalid).