So is that to assume if I pulled out a regular pepper spray the bad guy would not use the illegal gun against me or my family?
In terms of being viewed as a threat my reason for mentioning CCW is how would that differ if we had CCW? If you carry concealed you don't flaunt what you have. You keep it hidden so you are not viewed as a threat.
There are officers I know that carries their guns off duty does that means if they use it they are at risk of another office shooting them since they are not in uniform?
A bad guy can shoot you for any reason, or for no reason. Pulling out a pepper spray can vs. gun to me is smarter if you are going to use anything. Pulling the squirt gun out forces the bad guy to react to that, which is a more predictable reaction than seeing a regular spray container.
Be honest. Do you think you are more or less likely to be shot or stabbed over pulling a can of spray, or a real or replica gun?
And there are instances of CCW "good guys" shooting at or covering a perp, then being mistakenly shot by police. Having a gun in your hands makes you a target.
As far as your argument comparing a cop with a real gun to the civilian with a gun: the cop has a badge and can identify himself to both the potential perp and bystanders (other cops). CCW gun owners don't usually have badges, unless you buy one of the CCW license wallets with the Concealed Carry badge attached. I've not heard of that CCW badge being credited with preventing a case of mistaken identity, even though that is its stated purpose. If he identifies himself, then it's much less likely he'll be shot by another cop. That isn't a guarantee. The military is all too aware of how often death by friendly fire occurs. There's no reason to believe COPs are any less fallible.
There is no "one size fits all" answer for your questions. Humans are unpredictable. You prepare for what is most likely, and then react quickly when things don't go as planned. Situational awareness...