Wars.The Ajuuraan sultanate was the only Hydraulic civilisation on the continent besides Ancient Egypt. The fact that even they could effectively manage their water supply is so embarrassing.
How the f*ck were medieval Somalis more intelligent than 21st century ones?
Colonizations.
Tribal conflicts.
Avoid them and use the system which is similar to KGB subversion to control next generation of Somalis. Remove the power of clan elders. Give power to educated Muslim scholars instead.