Certainly. Historically, Native Americans campaigned for the formation of the Native American Grave Protection and Repatriation Act because people were digging up NA’s (and even re-burying remains of white people) and sending the NA remains to labs. There wasn’t the most robust ethical framework for human remains back then.
And there still isn’t. I mean, because it’s unregulated, it can be hard or even impossible to tell if something was graverobbed or donated, or found washed up outside a cemetery after a flood. And sometimes science is like “wait, how did you get this dead fetus? you bought it from someone who bought it from someone who just kind of stole it? and definitely took it out Peru illegally. well ok!”
There are scientists and ethicists who do care and comment on that stuff though. And there are some scientists who are trying to thwart things they find unethical, like Instagram sales of human skulls.
But I don’t think that’s why people incorrectly say all trade in human remains is illegal. If you wanted people to stop trading in human remains, it sure wouldn’t make sense to act as though it’s not happening, or that the law will stop it.