I had the same issue as a Warrior. I was fighting with a bow (because the enemy was far too big for me) and was running out of stamina from running away. But sometimes it would suddenly replenish, but only when it was completely out.

It is a bug. A helpful one at that.