Try reading a bee its rights as it lays dying. They do not listen.
When bees become an endangered species, would it be illegal if one were to sting you?
In this hypothetical system, bees would become akin to cops where it would be up to themselves to enforce rules, moral/ethics, and systems.
In California we have both the federal and state Endangered Species Acts. The common honey bee will not make the lists because it’s not native to North America. We do have endangered bumble bees, but they rarely sting, and they don’t die from it. So, no.
But in case you’re worried about harming endangered species… It is illegal to “take" one, which means to harass, harm, pursue, hunt, shoot, wound, kill, trap, capture, or collect, or to attempt to engage in any such conduct. So in theory, a bee dying on you is not the same thing as killing it.
I have no idea how protection for endangered colony insects works, but it might make the most sense to just protect the hive and queen instead of every individual colony member.