Bike shifts well for low gears OR high gears - but not both I have been having issues with my 9-speed rear derailleur and was hoping somebody could help shine some light on it. Thanks in advance! I can adjust my rear cable tension such that either the few top gears or few low gears will shift appropriately, but not both. 

If I tighten the cable, the shifting for gears 1-2-3 is very smooth - but then trying to shift to 4-5-6-7 it gets a bit more sluggish and then 8-9 barely work at all (i.e. if the shifter is set to 8 it will stay in 7, and if the shifter is set to 9 it will stay in 8).

Conversely, if the cable is loose the bike shifts well in gears 1-2-3-4, but then it is very sluggish for 5-8, and when the bike is in 9 the chain is constantly trying to "jump" into 8th.

What I've done:
-The lower limit screw is set such that when the cable is disconnected the bike pedals in 1 smoothly
-The upper limit screw is set such that when I push the derailleur inward the bike pedals on 9 smoothly and I am unable to force the chain into the spokes
- I've replaced the derailleur hanger (as I read this is a common issue when a few gears present shifting issues)
- I've adjusted the B-tension screw such that the derailleur cog is 5 mm from the biggest cassette cog when in 1st gear

I'm wondering if the "range" over which the derailleur is moving left-right is slightly smaller than the cassette's width and therefore by tightening the cable I can force it to match the low gears fairly well, and vice versa for the high gears. I've googled pretty extensively and haven't found anybody else describing this issue unless they are trying to match shifters, derailleurs, and cassettes with different gear counts, which I am not.

If it's helpful: I recently converted by bike to a 1x9 using Shimano Alivio 9 speed shifter, Shimano Alivio Shadow 9 speed rear derailleur, Sunrace 11-40T 9 Speed Cassette and a JGbike derailleur hanger extender (the derailleur cog was running up against the biggest cassette cog)
When gears shift cleanly only over part of the cassette, it's often due to the alignment of the rear gears.  If you look directly at the position of the cassette gears and jockey wheels as you shift up-and-down, is the angle not-quite-right when the chain won't shift properly?

Even with a new hanger, if the gear mech itself or the extender has been bent, you might need to bend the hanger out of shape to compensate.  You can buy a hanger alignment tool if necessary (about £65, so not cheap).

Also... is it the smaller gears that aren't shifting?  Is there enough tension in the chain?  If you've bought a new chain, be aware that most are supplied with several extra links that you need to remove with a chain-splitting tool (which costs less than a tenner).

Otherwise, any kinks in the gear cable or grit/gunk in the cable housing could be affecting the cable tension.  It's worth replacing them periodically, and it's both cheap and easy to do.  You'd probably want to buy a good quality pair of cable cutters, though (£15+).

Hope this helps :-)