Will spraying the bees make them die or go away?
Simple answer: No.
The wax comb that honeybees build blocks most of hive from whatever you are spraying into the entrance. So you may kill off the bees that are at the front of the hive, but you aren't going to reach the bees in the back of the hive.
The poison will weaken the hive, and it might die off, but it might not. Especially if the queen survived the poisoning.
And if the poison does weaken the hive and the bees die off? You will still have honey in your walls. And the bees are no longer there to protect it. Which means you will now have ants and roaches and other things going after the honey. It will get messy.
Bees keep their honeycomb protected and the honey capped so that it's a nice, neat home. Once they are gone, it's not.
After the ants and things eat away all the honey, there will still be old wax comb left in your walls. This wax comb smells great to a scout honeybee looking for a new home. A year or two from now, a new colony of bees is likely to move in, drawn by the smell of old wax.
When I remove the bees from your house, I remove all of the wax comb, and spray paint the space to mask any remaining smell.
Many of my jobs have a current colony of bees in a spot that has hosted bees in the past. The old comb from past hives is dark, while the new comb built by the current bees is white. When bees inhabit a spot over a decade or more, the wax comb can take over an extraordinary amount of space. I've removed over 100 sq feet of wax comb from a roof where bees had been allowed to live for over 20 years.
Also, spraying the bees until they weaken and die is not an overnight fix. You won't wake up the next morning and have no more bees.
Finally, you are spraying poison. It's not good for your family. And it's not pleasant for me when I am working in a space that's been poisoned recently.
The bees don't like it either. We need to protect our pollinators. Please don't spray poison at honeybees.