This can be a very frustrating problem. Yarn from the same dye lot is SUPPOSED to match--although I have had experiences where it did not.
I have a really great "go-to" book, The Knitting Answer Book by Margaret Radcliffe, that suggests blending the "old" and "new--wrong dye lot" yarn together by alternating rows. When you see you are running out, stop to reserve the old yarn. Then alternate--a row of old, a row of new, etc.
It depends on what you are making as to whether it is easy to disguise.