Fair enough. I’m not questioning whether such action is illegal.
I’m questioning whether you are legally covered if you resist intrusion with force or even lethal force.
If you know the guy is a cop (or you think he is, he could of course be a phony) and he is forcing his way in, are you legally covered if you blow him away?
Perhaps you should be, but I suspect in most states you’d get a trip upriver for a long stay.
You might want to check muawiyah’s posts on this. There are points that blur the lines, although I’d prefer to err on the side of home defense aganinst possibly tyranny or scams.