Cicada Killer – Wasp or Hornet? Wasp it is.
Large digger wasp (inch to inch and a half) and solitary in nature. Females look for cicadas and then dig a hole and lay one egg on that poor little cicada. That little larva eats the cicada and then pupates and finally in the Spring digs it’s way out and looks for a mate.
So probably just accidentally flew into a door which was open and then became trapped. I’ve heard that they seldom sting, the one in my office looked mad and if it was able to get out I think it would have gone after me. OK probably not but if able to release it would go on its way to find some more cicadas, helping with pest control.