Why cant I retreat?

I have sheaymin on the bench but when I tried to retreat Glaceon it said that I don't have enough energy. I didn't retreat in this turn either.

It happened again when I tried to retreat Leafeon later. It forced me to use energy.

Is this some bug or a mechanic that I don't understand?

I won the match BTW.