Unstuck Program

My ai keeps throwing the ball too close to the wall when on pro and it gets the ball stuck inside of it. I put stuff to stop it from going through the barrier entirely but sometimes it won’t, and it’s extremely annoying. Can anyone help me with this?