When public employee union members challenged state laws requiring them to pay dues in 2016, the Justice Department backed the unions, arguing to the Supreme Court that the fees were an important part of the operations of government.

Now, with the issue back before the high court, the Trump Justice Department has reversed course and argues forcing payment of dues violates workers’ free speech rights, since they may disagree with the very positions their cash is being used to advance by union leaders.

That case, which will be heard by the justices later this month, is one of four to reach the court so far where President Trump’s solicitor general has reversed an Obama administration policy and argued for the other side.

“It’s always good to have the U.S. Solicitor General on your side, so it’s significant in that sense — we are glad they came around,” said Jacob Huebert, a lawyer representing the union member bringing this month’s legal battle over the union dues.

But the justices have been less enthusiastic and often critical of the flips.

“There’s a 24-year history of solicitor generals of both political parties under both presidents of both political parties who have taken a position contrary to yours,” Justice Sonia Sotomayor told Mr. Trump’s solicitor general during an argument last month in a major case involving Ohio’s process for stripping inactive voters from its rolls.

“Seems quite unusual that your office would change its position so dramatically,” she said.

The other cases where the Trump team has switched sides included employee rights, where the new administration backs companies being able to force arbitration in contracts and a challenge to the constitutionality of administrative law judges.

“It seems like wiping everything Obama did from the books,” said Lucas A. Powe Jr., a law professor at the University of Texas.

But Miguel Estrada, who served as assistant to the solicitor general for President George H.W. Bush, said it’s not uncommon for a new administration to take a different position or new legal approach.

“When the Clinton Administration came into office, for example, they changed sides in several cases, including a high-profile civil rights case,” said Mr. Estrada.

During Mr. Obama’s time in office, his Justice Department reversed course in five high court cases over the course of eight years.

Michael W. McConnell, a former appeals court judge who’s now a professor at Stanford Law School, said Mr. Obama’s flips occurred around the time of his reelection, in contrast to Mr. Trump‘s, which have taken place at the beginning of his administration.

“They are less likely to result from philosophical differences between the political parties if they occur later in the administration,” Mr. McConnell said.

The Obama case flips included the legality of the Defense of Marriage Act, retroactive sentencing, medical malpractice and international corporate liabilities, standards for employee health care, and pension plans.

Mr. Estrada said the switch itself isn’t as important as how the government’s lawyers do.

“The job of the government’s lawyers is to win the government’s cases. It is not to please talking heads,” he said.

For Mr. Obama, his solicitor general won three of their flips, but lost two. Meanwhile, Mr. Trump’s four reversals are still pending before the court.

The administration’s intervention in a case usually means the side they support gives up some time during oral argument to the government’s lawyers so they can argue their interests.

That will be the situation in roughly two weeks when Mr. Trump’s solicitor general, Noel Francisco, argues against compulsory union dues before the court.

“It may make a difference to the justices, to the extent that the government can provide a broader perspective,” said Josh Blackman, a professor at South Texas College of Law.