Probability of catching a pokemon
Solution 1:
After reading this article, from my understanding, the catch rate of the pokemon is what is shown in the screen.
There are two things that affect the catch rate, the Pokémon's base catch rate, which is the section of the gauge that increases first after defeating the Pokémon, and the bonus catch rate, this increases depending on how many moves/how much time you have left after the Pokémon has been defeated.
This means if the gauge says "95%" then there is a 95% chance of catching that Pokémon. But that also means there is a 5% chance you will not catch that Pokémon. Unfortunately, you just got unlucky that time, but hope is not lost because you are able to retry as many times as you like.