I've noticed this a lot and though it doesn't break the game it's very annoying and seems like it should be changed. Basically the player party moves towards the enemy in way that they don't catch them when they're fairly cornered and will loop around forever....
Vid from today on 1.5.5 beta + hotfixes
And here's a vid from some versions ago showing same problem
Vid from today on 1.5.5 beta + hotfixes
And here's a vid from some versions ago showing same problem

