Check your index finger in your follow through. .
✅If it is snapped along your target line then the ball will likely go straight. .
❌If it is snapped so that your pinkie is down then you either had your hand too much on the left side of the ball or pushed with your nonshooting hand. .
❌If it is snapped with your thumb down then you likely hand your shooting hand on the right side of the ball at your release point.
🏀Everyone will make the occasional mistake like this, and some of those will even go in, but look to see if you are maligning one of the mistakes consistently. If so, now you know what to fix. .