Anything that may have changed the chain line up sometime in the past history of the bike? A slightly worn chain may have been flexible enough side to side and worked well enough. But with new chain and cassette it no longer does?
That'd pretty much be a crankset change or a BB of the wrong spindle length being put in.
Does it seem to be the smaller sprockets or larger sprockets on the cassette that it has the issue with when in the small front?
Perhaps you sized the chain too long. Did you match the length to the previous chain?
Even though you put a new RD hanger on, did you check to make sure it's aligned properly with the wheel?
But b-screw is the one of the first things to check as
2old said. It should be adjusted to let the jockey wheel be as close as possible without interference to any of the sprockets.
Welcome to BF.