So, the "scientific consensus" of that era involved a number of scientists from many countries who agreed with policies and goals that, in retrospect, we now see as not only politically partisan but also specifically aligned with Nazi political ends.
Your argument is a very common one but very flawed. Antisemitism, ultranationalism and eugenics aren't bad because the Nazis did it. It's exactly the other way round!
Eugenics are just as flawed and criminal when a Swedish doctor or a British politician advocate for it.
If the scientists of that era said that certain humans were an inferior species to Homo sapiens, and the scientists after World War II said that's not true, we shouldn't assume that the pre-war view was pure untainted science and the post-war one was the result of overcorrecting for political/moral reasons - we should consider the possibility that the pre-war scientific consensus was tainted by political/moral views that we now rightly reject.
Its incredible how little people know about the period in American history between the end of Reconstruction and the start of WWII beyond just: "WWI", "Market Crash", "Great Depression".
Following one theme: Nadir of race relations, Red Summer of 1919, and Great Migration (one of the largest movements of people in history).
https://en.wikipedia.org/wiki/Nadir_of_American_race_relatio...
It makes it so much more difficult to have an objective discussion about the past simply because people are unaware of it, or simply understand it at a very high / hand-wavy level. "Some bad stuff happened then eventually it stopped."
This was a time referred to as the "nadir of race relations" in the US, and if you read the output about humans as a species from that period, you'd be a lot less impressed. It's all out of copyright and a lot is available online. It's not what most of us would look at as science, now. It's more like mythmaking.