I have looked into the dark, and see 40 millenia of stagnation. From my deck of many cards, let's draw them one at a time and see what we get.
The First Card: Strife
The first plague to befell your people is here in the first card. It is a rider upon a horse. He is carrying a spear in his hand and has a bow draped across his back. Dressed in skins, he bears a dark countenance. Behind him we see a stylized burning city.
Migratory riders have been the bane of urban civilizations for millenia, and nothing after the invention of the stirrup until the rise of fast-firing gunpowder weapons could push them back. Rising and falling in numbers on the steppes in line with drought-plenty long-term rain cycles, these wild and savage men of the deserts and steppes will ruin cities, drag off women and children into miserable slavery, and undo the work of many generations in one night.
The Second Card: Plague
A skeletal figure is playing a musical instrument, while three skeletons dressed in rags form a circle and perform a danse macabre. More bodies are depicted on the ground, with dark lumps growing on their bodies.
Virulent outbreaks of plague can sometimes wipe out entire civilizations, such as many of the North American agrarian civs were utterly wiped out from history by the arrival of European disease. A set of plagues brought down the Roman empire, and a second, laid down the Eastern Roman Empire and the Sassanid, making them easy prey for fanatical desert tribes under a new prophet. With virulent vectors, disease outbreaks can sufficiently hamper urban agglomerations, enough to prevent the seeds of industrialization from germinating. Without cities, there is no demand. Without demand, there is no specialization of labor, no scientists, no industrialization.
The Third Card: Famine
The card depicts a very emaciated cow, its udder dry, its ribs strongly outlined by its skin. The land surrounding it is dead, with sparse vegetation and cracked earth. A punishing sun shines mercilessly above.
Long term climatic shifts have brought down many major civilizations, including several major Egyptian dynasties, Mesopotamian empires, the entire Mayan civilization, put an end to Viking expansion and their precocious North American colonization drive. Harvests fail not simply one year, but dwindle and fall decade after decade, until urban life becomes unsustainable without punishing taxes. Aside from climatic shift, ecological degradation from unsustainable agricultural practices (primitive irrigation, excessive pasture use) can render a region useless for centuries while the land slowly (if ever) recovers. What is now the vast emptiness of the Lybian desert used to be called the breadbasket of the Roman Empire. The whole of Sahara used to be a pleasant savannah 10,000 years ago. No longer.
The Fourth Card: The High Priestess
A woman seated, wearing bright blue robes and an elaborate head-dress, with a holy symbol hanging from her neck. She has a scroll in one hand and behind her is a tree of life, with a snake slithering on a branch.
The power of belief is never to be underestimated, both as a tool for social control and as a deep motivator of human action. Under the severe environmental stress induced by the permanent laying down (playing) of the first three cards, a society would seek solace in afterlife, and rely upon religious authority figures to impose what we would consider an impossibly oppressive and deeply conservative set of beliefs and practices. With people living on the edge of subsistence, deviation from the norm is death. The writ of tradition is sacred, and any deviation a threat to the entire community. Inquiring into the workings of nature is seen as foolish in light of cyclical perspective induced by millenia of stagnation, almost tempting divine retribution.
The Fifth Card: The Merchant
The fifth card depicts a merchant. His distinctive clothes set him apart, as does the conspicuous bag of gold strapped to his belt. He carries a bag on his back and a dog is nipping at his heels, as he looks furtively back along the road towards a town. A ship is shown sinking in the distance, upon a stormy sea.
Trade, long-distance maritime trade and well as caravan-based intercontinental routes have been a vital link, ensuring that technology lost in one place (such as water mills in western Europe after the Roman empire) eventually made its way back, and that discoveries at one end of Eurasia eventually percollated across the continent. Formidable geographical barriers, anti-capitalist and anti-mercantile bias, regulations and expropriations, hostile tribes and pirate infested seas can prevent this long-term knowledge transfer path and prevent the slow accumulation of knowledge that would otherwise occur.
The Sixth Card: The Wheel
The wheel of fortune shows a carriage wheel. Three beasts are depicted upon the wheel, the top one wears a crown and wields a rod of command, on the left is a beggar facing down in ragged apparel, while the right is a golden-haired beast ascending.
Many millenia of stagnation, and the vague memory and vast ruins of countless past ages of glory will probably be the strongest factor in making the middle ages permanent. This cyclical view of the world, whereby all that is great will come down is in sharp contrast with the linear ascending mindset of a peoples who have seen the wonders of an industrial revolution. By contrast, the inhabitants of this stagnating world will have memories of empire upon empire upon empire, foundering like so many waves upon the rocky shores of time. The weight of history and the ruined splendor of the past's might, with the pessimistic, golden-age-past ancestor worship this is sure to engender, will be the strongest inhibitor of a scientific and industrial revolution to come.
I dare not draw another card.