If you have been in a crash or ruined the bike someway, This can be the likely cause. It is additionally probable, but more unlikely, that the limit screws are causing this Misaligned gears might cause the chain to rub against the front derailleur cage or shift inconsistently. This problem https://mybikereview.com/bike-gear-indexing/