"homeowner stops baddie in their home" is incredibly rare and almost never happens.
What does happen, however, is: homeowner commits suicide with their gun, or homeowner's children shoot themselves or a friend. Having a gun in the home is associated with a significantly higher suicide rate.
The facts don't bear out the necessity of protecting oneself against late-night home invasions.
Burglars prefer mid-day because there's less chance of finding someone home and penalties are lower; in many states a nighttime break-in pushes the seriousness of the charge up quite a bit, as does breaking into an occupied home.
Burglary rates have plunged over the last couple of decades, 75% since the 80's. The country-wide rate is 440 per 100,000 people, or a rate of 0.4% per person per year. The rate has little to do with gun laws or ownership rates; the rates are highest in southern states, lowest in northeast states like MA and NH. It's a function of poverty rates and how desperate people are, not how easy it is to own a gun.
What discourages home invasions: Locked doors/windows, landscaping that doesn't hide people while they're attempting to break in, motion lights, security cameras...and having government services that help people in poverty.