risk reward analysis. i'm 3x more likely to die falling off a ladder than during a home invasion. Further having a gun doesnt prevent home invasions, and adds risk of elevating a non-fatal robbery to a gunfight.
So you're proposing it as a necessary protection and preparedness, I'm recognizing 1) that the risk of your proposed scenario is very low and I'd be better rewarded focusing my efforts preparing for other hazards, such as improving my diet and exercise
2) that the proposed solution of having a gun to protect myself is not the best or only solution, and is only successful in preventing the crime less than half the time.
3) A gun could actually make the situation worse, and this is also true almost s often as the success case- tha the gun is used against the victim, or that the gun escalates a nonviolent crime into a violent one, and can force fatality as an outcome.
and bonus 4) a gun in the house adds additional separate risks of enabling suicide, accidents or fatal emotional outbursts, which are all far more deadly than the imagined shooter coming to kill me.
So TLDR; guns are an ineffective solution to a unlikely problem and actually increase risk.