To have the two wheels index the same, the cassettes have to be the same distance from the RD.
In practice, that means that the small cog should overhang the end of the freehub by the same slight amount on both wheels.
This can be adjusted by putting shim(s) behind one of the cassettes. Thin shims can be found to buy with difficulty, or easily cut with scissors from an aluminum can.
A new cassette might improve the situation, but I wouldn't count on it.