Pannier rack restricting dérailleur movements
I would concur that the solution here is to increase the length of the cable housing that is inferring with the rack. If the rack is putting any pressure on the cable housing, then it will interfere with the ability of the derailleur to shift properly. Depending on how much free cable is left over coming out of the derailleur, You will most likely need to also replace the cable with a new one that is longer.  But this shouldn't cost any more than $10~$20 from the local bike mechanic at the back of your favorite bike shop.