5th dnd – Balance problems to level up in the middle of a fight?

I'm planning a match for 4 level 2 players and I plan to move them to the next level in the middle of the fight. I wanted to describe this a bit like a power within awakening, like many popular animated people. To do this, I want to balance the meeting between 8 players of level 2 and, when they will increase, they will have sufficient resources, as after a long rest. I want them to upgrade in the middle of a fight after spending a few resources and realize that the situation is disastrous.

What kind of balancing problems will result? Are there any facts that I miss and that will ruin the game?

I'm sorry if this question has already been answered, but I can not find it. I found this one similar, but it comes from the dungeons world and I do not know if there are any similarities.
Can I make the Top Level move do not require so much time without interrupting the game?

In addition, I do not find rules to know when to level up or if players have to rest to do it. If there are such rules, I would also like to know them.