No, it has to be reasonable to believe that they had permission to be in the apartment. I am going to hope that the laws holds people to a higher standard for killing someone than 'oops, my bad.' If the laws holds that she had the right to kill someone because she is too stupid to figure out she was not in her own apartment I'm going to change my stance to full repeal of the 2nd amendment. At that point I'm fairly sure our society is simply to stupid to be allowed to own guns, or perhaps any pointy object at all.
My answer was for trespass, not for murder. It appeared that someone was making the following argument:
1. She knowingly killed someone.
2. She claims self-defense as a justification.
3. The law prohibits a claim of self-defense when the person using it was in the process of committing a crime.
4. She was committing a crime by trespassing, therefore, she can't claim self-defense.
My response is:
5. Criminal trespassing requires a specific intent to be on property without permission.
6. She thought she had permission, therefore she lacked the specific intent (I believe there is a jurisdictional split as to whether her belief had to be reasonable in this regard).
7. Therefore, self-defense is available.
The next step would be:
8. To prevail on self-defense, her belief had to be both reasonable and honest (I believe some jurisdictions will allow a downgrade to manslaughter for an unreasonable, but honest belief).
Most people will never prevail on #8 because going to the wrong apartment while carrying a loaded gun is likely to persuade a jury you didn't honestly make a mistake, even if it is reasonable that you could have. A peace officer tired after a long shift might be a rare exception where honestly is believed, but there will still be a question as to reasonableness (especially if the decor and/or the presence of a person should have notified her that she was in the wrong apartment before she fired).