It's set up so that if you are right next to the enemies and try to hit them, they will have priority and kill you first, otherwise players could cheese the combat where you need to consider where you are positioned before attacking. It is very weird though, so we're adding some new mechanics and changing the visual order of things to correct this aspect of the game that feels off.