WARSAW — Andrzej Duda was a relatively obscure member of the right-wing Law and Justice party when the leader of the party and the most powerful man in the country plucked him from the chorus line to become its candidate for president in 2015. For most of the party’s first 20 months in power, he was a reliable proponent of the governing party’s nationalist initiatives.

On Monday, President Duda defied his patron, Jaroslaw Kaczynski, and vetoed two bills aimed at placing Polish courts firmly under political control.

“It seems that the reality inside the ruling camp is more complex than we might think,” said Rafal Chwedoruk, a political scientist at the University of Warsaw, in an interview with the Polish Press Agency.

There were already whispers of growing friction between the two leaders, an apparent schism that reflects a broader divide that has split Poland. The country was once in the vanguard of the democratic change that swept the region after the collapse of Communism. But it has steadily moved toward light authoritarianism and strident nationalism under Law and Justice, which has systematically dismantled much of that progress.