I wanna add also that it was not due to a lack of literacy or localized learning.
Literacy and localized learning was extensive in the early modern period both in the hinterland and on the coast, not limited a elite/rich or the clergy.
Notice he mentions women teachers.
A good indicator of the high literacy rates and learning in medieval period can be indicated by how available learning was so much so that you had women scholars and teachers . A few examples :
This also can be seen in the number of female saints/sheikhas ''Ay's'', tombs/graves in the ruined medieval town of Dogor in Northern Western Somalia
Are Baraawes of Somali origin or are they just Swahilis that became Somalised