There's actually multiple PODs in which this could be achieved, both Islamic and Christian.
For a prime Islamic version of this, 11th century Al-Andalus (with a POD in the late 10th century). A similar (but hopefully not the same one) succession crisis could occur in the Caliphate of Cordoba, in which it leads to a de jure Decentralisation, with maybe some type of Islamic Majlis, in which the leaders of the Taifas elect a Caliph, similar to how the early Rashidun Caliph's were chosen by the men of influence. Hopefully this succession crisis isn't the same one as the one between the post - Hisham II Umayyad's and the family of Al-Mansur, as that one happened perfectly for the Christian kingdoms to capitalise. Leon, Castile and Navarre had been United in their fear of Al-Mansur and were able to take many land grabs during the 20 years of strife in Al-Andalus. Aside from that the Caliphate was actually somewhat similar to the HRE in that the Caliph had little power outside the capital, and had to rely on semi-independent vassals a huge amount, only difference was that this was part of the HRE intentionally.
A good Christian Iberia equivalent would be wanking the realm of Sancho the great of Navarre, who also controlled Aragon, Castile and conquered rhe Leonese Capital. Perhaps he does a bit better to consolidate his various territories, and unites them enough so they don't divide upon his death. His title of King of Spains could become the elected title for his future heirs, with the various realms of Leon, Castile, Navarre and Aragon (and perhaps a few captured/converted Taifas too) electing a "King of Spains" between them, aside from this it could a heavily devolved state, also hopefully no Almoravid invasion so this state can pick off the Taifas easier, maybe even adding them into the elector states (supposing they convert to Catholicism).