Let's say a monarch has three sons. The second one becomes a clergy member and his elder brother becomes king upon their father's demise. Then the eldest brother, now king, dies without issue. Would the throne pass to the second brother or the third, who is not a clergy member? Do a priest's vows disinherit him? Has this sort of thing ever happened?
In my previous answers here and here I covered a situation which transpired in 1578 when Portuguese king Sebastian died in the defeat at Alcácer Quibir and was succeeded by his uncle, Cardinal Henry. To quote myself:
Equally important, and probably more disastrous Sebastian left to this war unmarried and without a heir. How he thought he could lead his troops from the first lines without securing the situation at home is bewildering and well, stupid. Following his death, next in line was his 66-year old grand-uncle Cardinal Henry, who was crowned King, but due to his priestly vows could not marry and have children. He died of old age two years later also heirless. The intrigues and a small weakly-opposed invasion then lead Spanish King Phillip II to the throne, creating to the Iberian Union and tying Portugal to many ongoing Spanish conflicts, which truth be told were looming anyway, but were now unavoidable.
As we see, in that particular case, it was indeed possible for clergy member to become a King. Although I wouldn't want to presume how much of a rule or an exception that was. It is interesting that the King had to ask the Pope to relieve him of his celibacy vows so he could marry and produce an heir, but the Pope refused. Again, not sure how much was this normal and how much was this unusual and subjected to schemes of King Phillip II of Spain who was aiming for the Portuguese throne