If I'm the judge, a bear inside a human habitation is reasonable grounds to be believe that you are threatened and can act in self-defense. Even if the bear isn't predatory, it is likely to feel cornered if a human appears and defend itself aggressively.
I agree. We had a case nearby where a 700 pound black bear was actively invading homes. A homeowner shot it in the head and didn’t kill it. Big pucker.
https://www.sfgate.com/news/article/Behemoth-bruin-terrorizes-Incline-Village-homes-3276299.php