WASHINGTON—A federal appeals court questioned whether Democratic lawmakers had a legal right to sue President Trump on allegations he was improperly profiting from his presidency.

A three-judge panel on the U.S. Court of Appeals for the District of Columbia Circuit suggested the lawsuit, filed in 2017 by roughly 200 Democratic members of Congress, was flawed because the lawmakers were suing in their individual capacities instead of bringing claims on behalf of the House and Senate.

“You can’t seek to protect the institutional interests of Congress,” Judge Thomas Griffith told a lawyer representing the Democratric lawmakers during oral arguments Monday. The case might be different, he said, if the House and Senate had passed resolutions authorizing the suit. Democrats had no real prospects for that official authorization when they sued because they were the minority party in both the House and Senate.

Judge David Tatel voiced similar views, saying the Democrats’ ability to sue appeared prohibited by a Supreme Court decision from June that said Virginia’s state House didn’t have legal standing to bring a case that challenged state voting districts.

“Why aren’t we bound by language like that?” Judge Tatel asked. Congressional Democrats, he said, would need to direct their arguments to the Supreme Court if they thought their case should be allowed.