First of all, not all bee species even have stingers and only honeybees have barbed stingers. Even then, honeybees do not always die when stinging animals, such as insects, as only mammalian and maybe avian skin is thick enough to retain the barb.
Calling this suicide or a sacrifice seems to imply that the honeybee workers are aware of possible death when stinging a mammal, which I haven’t read evidence of, and I don’t think it’s something we have the ability to know. And honeybees only live a few months, so it’s a very human-centric viewpoint nonetheless.
Is it known whether this is an evolutionary strategy vs an evolutionary mistake? I suppose that isn’t really a question we can answer. The only thing I can think of is that mammals are larger and if the venom keeps pumping after the bee removes itself, then that would inject more venom. But for larger animals, is there a strong need for the bee to only be active in the sting temporarily? It seems a honeybee with a smooth barb could just sting a larger animal longer, removing the “need” (of the above hypothesis is true) of stinging for a short time but leaving the venom producing system behind.