Hey there! The waiting glitch is a common glitch and can be fixed by /endbattle. In important battles like gyms or E4, you can make a support ticket in the
Discord to get the trainer reset so you can retry your battle without the glitch. There are instructions on how to make a ticket in the #help-and-support channel. Before making a ticket make sure you take a screenshot of the waiting glitch so we can actually help you. Hope this helps!