If you have a hero in a battle, you win the battle and the hero raise level. When you only resolve with auto-battle, first it shows you that your hero increase in level and then in shows you the victory screen.
I think it's more logical that you first see if you win the battle and then if some heroes level up, you show the level up screen.