When coming into contact with a Pokeball that is suspended midair during an out-of-battle catching animation, the catching animation sometimes skips to the shaking phase early. This also causes the Pokemon's "getting sucked in" animation to start looping, making it blink red. The overall catching process is not broken in any way; just the animation. Once the pokeball is done shaking, the Pokemon is caught/breaks free correctly.
Reproducing the bug is somewhat inconsistent, make sure to be in the hitbox of the ball especially as it stops midair to open. Try catching in a flat, open space to make things simpler. You should get it in a few tries. F3 + B to show hitboxes helps a lot.