You're missing out a period between the Roman Empire and the Great Divergence of the 1400s-1800s: the era of the Caliphates. In that period, you could arguably make the opposite case: that North Africa was leaving Europe in the dust - the Umayyads carved out an empire as large as that of the Romans, for example, and Northern African armies marched as far as Tours in France and conquered much of Iberia. Islamic learning and civilisation spread through North Africa, and North African corsairs were also an extremely significant economic and military force during much of the early Medieval period, raiding as far as Norway and the British and Irish isles.
I think that you are mistaken in assuming that North African membership of the Roman Empire was still relevant by the time that the conditions that would lead to the modern Euro-Atlantic world were coming into existence.
I wrote a decently long response to a similar question a while back - https://www.reddit.com/r/AskHistorians/comments/2f0d8e/how_did_north_africa_go_from_being_one_of_the/ck4rzyg/
I also agree with u/124876720's comment about North Africa being more prosperous than Europe for much of Late Antiquity and the Middle Ages. S.D. Goitein, who is one of the most prolific scholars of the medieval Mediterranean for his work on the Cairo Geniza, at one point argued that Tunisia in the late-tenth and early-eleventh centuries was "The Hub of the Mediterranean."
"Later in history" would mean after the establishment of the Ottoman Empire & its decline.
We can take the 7th Century Arab conquest of North Africa as being the time when N. Africa became socially and politically separate from the Christian north side of the Mediterranean. For centuries, Islamic societies were way ahead of the West socially and culturally.
This changed with the Ottoman Empire's decline and the general turn of Islamic cultures into a sort of inward conservatism that did not allow much in the way of social or technological advance. It is controversial where this inward conservatism came from. Will Durant thought that the Crusades and Mongol assaults on Eastern Islam had something to do with it.
But the Muslim world afterwards fell behind, and it was not till some time after 1720 that, for instance, a printing press first showed up in Constantinople. Constantinople was then the largest European city, and the lack of social and economic, as well as technological progress, would have been even more evident in provinces on the periphery, such as North Africa, despite the fact that individual residents might live in safety and comfort.
A similar inward conservatism existed in Catholic countries, but not as strongly, and there was much less of it in North Europe, where religious and social revolution (Martin Luther, the English Civil War, the Glorious Revolution etc) allowed for a lesser concentration of wealth, more social mobility, and modernization. North Africa, more to the south and farther from these social currents, changed but little.
Another factor would have been diversion of trade around Cape Horn (after 1500) rather than going though the Middle East, making the Mediterranean somewhat of an economic backwater.
North Africa lacked modernizing leaders such as those who hauled Japan (19th Century) into the modern age, or Peter The Great in Russia (17th Century). This situation left it vulnerable to colonization by France and Italy closer to our times.
In short, Western Europe and Russia went though various revolutions that allowed better technology, better economic systems, better armies and navies, modern industry, and more wealth. North Africa has had to play catch-up ever since.