Thailand inched closer to political gridlock on Thursday as politicians gathered in Parliament to vote for the next prime minister with no clear victor in sight.

The leading candidate, Pita Limjaroenrat, a charismatic young progressive, was dealt a major setback on the eve of the vote when Thailand’s Election Commission asked the Constitutional Court to suspend him from Parliament.

Mr. Pita, who scored a major political victory over the ruling military junta and its royalist allies during the general election in May, has been under investigation for allegedly owning undeclared shares in a media company. On Wednesday, the Court also said that it had accepted a complaint against Mr. Pita over his calls to amend a law that harshly penalizes criticism of the Thai monarchy.

Neither blow stopped Move Forward, Mr. Pita’s party, and other coalition members from nominating him for prime minister on Thursday morning. But the setbacks will make it that much harder for him to win the support he needs to become prime minister, raising the prospect of fresh pro-democracy street protests in a country that appears fed up with military rule.

Thailand has a long history of military coups, and Mr. Pita’s supporters largely see him as a victim of a military-dominated political system that they say is trying to thwart the will of Thai voters once again.

The Election Commission’s decision to recommend suspension will be “used as a new argument by the senators to not vote for Pita,” said Wanwichit Boonprong, a political scientist at Rangsit University.

In order to become prime minister, Mr. Pita or one of his allies would need enough support in the 500-member House of Representatives to overcome opposition in the 250-member, military-backed Senate. Anything less than 376 votes — a simple majority of both chambers — would leave the process deadlocked.

Mr. Pita was widely expected to fall short of that target on Thursday. A second vote for prime minister would be held on July 19, and a third, if necessary, a day later.

Mr. Pita’s progressive coalition may not be strong enough to weather a loss if he is defeated. Members of Pheu Thai, the second-largest party in the coalition, were expected to vote for Mr. Pita but could try to form a new coalition that is led by one of its own candidates for prime minister after Thursday.

Pheu Thai could field Srettha Thavisin, a property tycoon who is considered a more palatable candidate to Thailand’s military establishment, if Mr. Pita, 42, fails.

Prime Minister Prayuth Chan-ocha, the general who took power after leading Thailand’s most recent military coup, in 2014, said on Tuesday that he would retire from politics once a new government is formed. But the military and its allies may try to hold onto power in other ways.

“It’s very complicated, and it’s very hard to predict” who will win, Mr. Wanwichit said.

Thailand is one of the largest and most important economies in Southeast Asia, a region where several countries have been sliding again toward autocracy after experiments with democracy. The country was once a stable ally of the United States but has moved closer to China under the current junta.

Mr. Pita told reporters on Wednesday that he felt the Election Commission’s move against him was unfair and should not have been made so close to the parliamentary vote. Supporters of his coalition were expected to gather outside the Parliament building in Bangkok ahead of the official vote for prime minister Thursday evening.

The vote, and the likely protests that will follow, could exacerbate simmering anger against the junta in Thailand, and perhaps trigger another bout of extended civic unrest like the ones that have accompanied previous military coups in the country.