If an enemy is raiding a settlement belonging to a faction you are not hostile to, and you join the battle, it (correctly) places you on the side of the settlement against the enemy raiding party. However, the text says that you have arrived to raid the village, and warns you that this will start a war with the non-hostile faction, even though it doesn't. So while everything works as it should here, the text is backwards.