I think the law is a bit different when that someone shows up at your door or is inside your house. Isn't that the essence of the Breonna Jones case? I was reading of a different case recently too.
If they've announced that they're law enforcement, it's a bad idea though. You may be in the right if you're just armed and not pointing it, but being in the right never protects you.