They are trying to get out.
They come in during the winter (they can squeeze into tiny cracks) and wake up in the spring. They are wanting to go out, meet friends and find a meal of baby greenfly.
Me to I put them out telling them to fly away home,their house is on fire and their children alone (think that's how the verse goes ,will have to check with 5 year old grandson he seems to know most things ) similar case for the butterfly I keep finding in the window .I thought they were coming in but yes it is more likely they are wanting to get out.
I will start opening the Windows again .I have had them shut thinking that's how they were getting in!
I had one or two in my garden last week one was in my greenhouse
I have to let them out too. Next it will be the hornets. Been nesting in our attic for years. I have to usher them out of the landing window in the summer.