It's Larian's bad way of doing it.

Character sheet:
The sword is doing 1d8 +1 so between 2 and 9 damage. The +2 acid damage is not is not taken into consideration nor is the 1-4 poison from here being a drow.

The flail has 1d8 +5 so between 6 and 13 damage. The +2 acid and the +1d6 necrotic are not taken into consideration


The weapon sheet:
The sword has the +2 acid added so between 4 and 11 damage.

The flail has the acid and necrotic damage added so between 9 and 21 damage.