I think I figured out what the vanishing stars bug does. So, it removes a few seconds from the battle after the battle ends, meaning it ends prematurely. That’s where the missing stars go. To make it all five stars, you need to find a way to extend the battle timer after getting the fifth star...