While leur is indeed incorrect here, I would like to correct you on one point.
You state
the gender of the possesive pronoun (sorry if I'm using the wrong term) should agree with the word following it (here, "ami"), not based on the gender of the pronoun itself, so there is no reason to use something like "their"
In French, a possessive article (formally, déterminant possessif, previously known as adjectif possessif) is based on both:
- the "personne" and number of the "owner"
- and the gender and number of the "owned".
The personne is je/tu/il/nous/vous/ils (1st to 3rd person singular, 1st to 3rd person plural), which denotes the relationship to the persons talking:
je (1st person singular) -> mon/ma/mes: the owner is the person talking, who is a single person
tu (2nd person singular) -> ton/ta/tes: the owner is the person being talked to, who is a single person
il/elle (3rd person singular) -> son/sa/ses: the owner is another person, who is a single person. Note that the gender of the owner does not matter.
nous (1st person plural) -> notre/nos: the owner is a group of people, the person talking being part of this group
vous (2nd person plural) -> votre/vos: the owner is a group of people, the person(s) being talked to being part of this group
ils/elles (3rd person plural) -> leur/leurs: the owner is a group of people, and neither the person talking or the person being talked to are part of this group. The gender of the owners does not matter.
So the person and number (but not gender) of the "owner" dictate the root. This is then complemented by a suffix which depends on the gender and number of the person or thing "owned".
- Suffix -on (
mon, ton, son): masculine or neutral singular or if feminine but the word after the article starts with a vowel
- Suffix -a (
ma, ta, sa): feminine singular
- Suffix -otre (
notre, votre) and leur (whole word): singular without distinction of gender
- Suffix -es (
mes, tes, ses), -os (nos, vos) or -s (leurs): plural without distinction of gender
So there are a total of 15 different forms depending on the combination:
Owner Owned Article
Je Singular, masculine/neutral/followed by a vowel mon
Je Singular, feminine ma
Je Plural mes
Tu Singular, masculine/neutral/followed by a vowel ton
Tu Singular, feminine ta
Tu Plural tes
Il/Elle Singular, masculine/neutral/followed by a vowel son
Il/Elle Singular, feminine sa
Il/Elle Plural ses
Nous Singular notre
Nous Plural nos
Vous Singular votre
Vous Plural vos
Ils/Elles Singular leur
Ils/Elles Plural leurs
Leur would have required the owner to be "ils" (and then its form would be independent of the gender of the owned).
But indeed, French does not use "ils" as a gender-neutral form. The traditional gender-neutral form is the same as the masculine. If you want to be explicitly more generic, you would write il/elle, but that would not change the déterminant possessif in this case, which would still be son/sa/ses depending on the gender and number of the "owned". More recently, you could use "iel", but that is usually used only if you want to denote that the person being talked to explicitly does not wish to be gendered (though I'm sure some take a different view).
As for the gender of the "owned", the default neutral is likewise the masculine form (as is echoed by the use of "ami"), so it would be "son". If you want to be explicitly inclusive, you would write "son ami(e)": the article doesn't change because even though is should be sa for feminine, one goes back to son when the article is followed by a word starting with a vowel (you wouldn't say "sa amie").