WASHINGTON—President Biden’s remark that Russian President Vladimir Putin “cannot remain in power” came under fire for muddying U.S. policy and threatening to undermine diplomatic efforts to end the war in Ukraine.

Administration officials and Democratic lawmakers said Sunday the off-the-cuff remark was an emotional response to the president’s interactions in Warsaw with refugees—some of whom had fled violence in Mariupol, a Ukrainian southern port city under weekslong Russian bombardment and attacks on civilians.