If her mind was strictly material, how could she know with certainty whether or not it was malfunctioning?
You have assumed:
--Ideas are in heads,
--There are external realities,
--Ideas (at least some) are about external realities,
--Minds are strictly material,
--Minds can function properly (else they could not malfunction),
--Minds can malfunction
All these assumptions are correct with one exception: Minds are not strictly material, in fact, the mind, which is what we call human rational/voliition consciousness, is not material at all. Material existense is that which consciousness is conscious of. One is not conscious of consciousness anymore than one can see their seeing. We know we can see because we do it, and we know we are conscious because we are.
Since you assume minds can function properly, there is no reason why Ayn Rand could not make the same assumption, and also be able to tell when it was and was not so functioning.
As for being certain "ideas in her head corresponded with an external reality...." there is no need to restrict reality to the external, because it includes the internal as well. Since both the internal and external is only that which we are conscious of, and since consciousness deals with nothing else, it is not possible that our ideas not correspond to the reality that we are conscious of, since they can be about nothing else. It's all we can have ideas about.
This assumes you do not want to take back any of your assumptions.
Hank
The problem isn't in her assumptions. The problem is that she (materialists) can provide no coherent explanation for truth or "the adequation of thought and reality."