Though I have never read Ayn Rand (and from now on I will be more cautious if I decide to read her books) I can't second more the point of your message about the existence of some books/theories that should be avoided at best. To add to your example, when I was about 16-17 I came in touch with the various strains and ideas of European nationalisms, I have read on topic extensively, rapidly abandoned the topic after two years of reading about it, but right now I clearly see how toxic and distortive the ideas of nationalism have been on my word view. I have abandoned them long ago consciously, but up until now a strain of thought most typical for the practitioners of nationalism may come to my reasoning from time to time, randomly and in most surprising places. It has so easily penetrated the whole corpus of knowledge I have got about this world, so that even now I need to carefully inspect my own thought on whether they are infiltrated by stereotypical nationalistic waste of any kind.
But, put it the other way round, I once thought that the toxic books containing easy-to-understand, sometimes appealing, but deeply-flawed or useless theories are a very good (but somewhat dangerous) way to exercise mind to check whether the mind is mature enough to stand the lure of a toxic book: if your world view withheld the pressure of the book to adopt its theory, then you passed the test, otherwise you are probably f*cked in a long term.