It's an old bug. If you've ended the previous fight in Autoattack mode, the first round of the next battle is messed up.
Just attack normally when finishing the last enemy and everything should be (hopefully) fine.