The exact thing is happening in my neighbourhood on a regular basis in the last year. And in some cases the burglar managed to get away with notebooks and other valuables while the owner were just upstairs for 5 minutes.
I'm sorry, but your anecdote smells. If you are robbing houses at random, the last thing you want to do is rob an occupied home. You rob an occupied home for a reason specific to that house or the owner of that house.
Most burglaries happen in the daytime when people are at work and their houses would be locked regardless.
And the most common form of home theft nowadays is package theft. Which isn't going to be thwarted by locking your home since, you know, the package is just sitting on the porch.