Is there a difference of spacing between cogs on a 7 speed cassette vs a 8 speed cassette?
When I got a new wheel (upgrade from freewheel hub), I tried to get a 7 speed cassette (SRAM) for it, but the local shop didn't have the spacers for the hub. Instead I swapped it out for a 8 speed cassette (SRAM), but kept the 7 speed shifters (shimano EF-51). I have a few gears in the lower and middle gears where the chain constantly tries to jump between. The higher gears are fine. The issue mostly went away when the tension on the cable was adjusted, but not completely. I noticed it may have moved the issue to another part of the cassette.
Update Soon after posting this I replaced the cassette with a proper 7 speed and all the issues went away.