Who has or doesn’t have a title is a matter of State law, not divine law. Should someone having that title (for the sake of the discussion, we will assume “prince”) go to seminary and be ordained, I seriously doubt the Church would say “you are no longer a prince” because that would be presuming State authority. It would be up to the State to determine if ordination constituted a change such that the individual would lose the title, or retain the title but no longer be in position to become king. The Church, however, would have the authority to say that the priest could not “ascend to the throne” unless laicized.
Carrying that forward, and presuming the State did not take away the title, should the progression according to State law indicate that when the current king dies, the ordained individual would still be next in line to be “crowned”, then presumably the priest would “abdicate” and the matter resolved to whomever followed him in line. The alternative would be either to request laicization, or to be laicized without consent.