The more interesting question is: what do we do with the art of people who were revealed to be terrible? I first saw people wrestle with this idea for Michael Jackson and recently it has been a big issue related to Kanye West.
The person who solved global warming/cancer/whatever turns out to be a terrible person? Should we throw away their work, and come to a different answer? Or wait a few generations so people forget and come to the same answer again but the people involved are “pure”?
For your thought experiment, I don't think we as a whole threw away the scientific work of the nazis. We have a concrete answer to that