No, there’s a problem there. Intent of the dead guy doesn’t matter, because there is no easy way for the homeowner to divine intent, instead having to rely on circumstances.
This goes all the way back to ancient Biblical law, that reasoned that it is justified to kill a thief in your home *at night*, but not during the day, which makes sense from several directions.
The guy was out of the house and running down the street!