Just failed a settlement defence. I got the warning that it was under attack so rushed over there and talked to the settlers. They spoke of gunners coming back to attack them so I had to repair and build defences, I built 3 new machine gun towers and it completed the "build defences 100%" part but then instantly failed the mission as soon as the gunners appeared.
Machine gun turrets killed gunners in seconds, no settlers were harmed but its still in my journal as failed.