The Rain Queen is a real-world example that meets some of your requirements.
There are also many explanations for the "contradiction" evolving over time.
Many vestigial monarchies exist today which have no official power (Sweden, Japan). In the past your queen ruled and reigned. Over time the monarchy ceded power to some form of a Republic – a representational government probably consisting of royal families – which has evolved into the current system. Since women tend to share power and negotiate as a group, this wouldn't necessarily be seen in a negative way as a "loss" of centralized power, it could be seen as the best system. The queen is a "mother" to her entire nation and her role is to see that everyone has enough, rather than a male-oriented Darwinistic zero-sum scenario where winner takes all and the powerful abuse with impunity. Another tradition might arise from daughters inheriting the home while sons go out into the world to find their fortune and become valuable to a woman to earn a place in her household. Women stay put, men travel around.
There are several ways in which the throne might be inherited, which you can use to make the disconnect between female reign/male rule less obvious. Since the queen is first a religious figure, the "divine" process that selects the high priestess is still the method that is used. Her duties as high priestess might be deemed "too important" to be distracted by petty details like running the economy (Christianity forbade money-lending, so a handful of Jewish merchants who were denied citizenship could still become wealthy lenders), and she may even be prevented from declaring war – a hopeful religious sentiment that is nevertheless unworkable for national defense.
In Saudi Arabia, the monarchy goes to living brothers over sons, so you might have a system where a sister or aunt becomes queen before a daughter. Another method might trace matrilineal ancestry to a founding prophetess or ancient queen, causing the monarchy to skip around between distant cousins of royal families – the lineage of the father may play a factor in determining who has more of this bloodline and that would influence arranged marriages to keep the bloodlines as strong as possible. As a result however, sometimes the throne shifts to a family without political clout, hence the strong constitutional republic intended to offset that possibility.
It's believed that early human societies were matrilineal before they became patrilineal. There would have been many instances where an existing female monarchy was usurped by an invading patriarchy. Religions and governments shift over time, sometimes as a result of population migration. People from foreign lands bring new ideas. A society can be stable, and incorporate contradicting ideas from different peoples and eras. There may be a disconnect between the ruling elite and the common people.
The legend of Helen of Troy shows artifacts of the matriarchy-patriarchy transition. Helen and her sister are the co-queens of Sparta. They are married to two foreign-born brothers, sons of a wealthy and powerful horse breeder (horses mean military power in the ancient world). Helen pulls the ultimate self-serving powerplay and heads for Troy where she is welcomed as a royal guest (and probably a demigod, you can't just kick these people out). This forces the brother-kings to rally unified Greece into a "world war" to bring her back, otherwise it jeopardizes their claim to rule. The Greeks lay siege to Troy but Helen has no intention of returning. Instead she watches from the wall for 10 years as the greatest heroes of a generation are sacrificed in one-on-one battles.
Long story-short, Helen's sister takes a new lover and rules Sparta (they kill her foreign-born husband when he returns). Helen shows her husband her breasts and instantly all is forgiven. After successfully destroying an impregnable superstate from the inside, sacrificing demigod warriors, and ending the Classical Age when gods directly meddled in human lives, Helen announces she is going to conquer Egypt next. This is all "true" to the legend, but it's obviously not the usual spin given by male authors throughout antiquity.
Archeological evidence shows the cult of Helen as a local deity existed before the Greeks, and survived long after the rise of patriarchy. Helen is a weirdly defiant hero that survives among the common people centuries after the rise of the military city-state. She's credited to Sparta which is an anomaly in the ancient world for it's male/female population disparity. Sparta also has a telling artifact in having 2 monarchs which seems very strange under patriarchy but maybe isn't so odd for a pre-historic matrilineal society where the co-queens would have been "sister-fied".