Common in compost and outhouses. I have both. They’re actually beneficial.
“What are Soldier Flies? What are soldier flies? These relatively large insects resemble black wasps, and yet they’re perfectly harmless to human beings and other mammals. They don’t have mouths or stingers, so they can’t bite or otherwise hurt you. The fly portion of this insect’s life is spent flying around and mating, then laying eggs and dying within two days. They don’t like to go in houses, they help to keep away the common housefly, and they prefer spots that humans shun such as manure piles and outhouses
Read more at Gardening Know How: What Are Soldier Flies: Help For Larva Found In Compost Piles
https://www.gardeningknowhow.com/composting/basics/soldier-flies-in-compost.htm