11-speed cassette, freehub and wheel compatibility I have two wheels and two 11 speeds cassettes. With one combination of cassettes and wheels, shifting is reliable. With the other combination, the position of the cassette relative to the derailleur is clearly incorrect and I get a lot of chain noise and spontaneous shifting.
The parts I have are:

Giant P-R2 rear wheel
Shimano 11-34 cassette, CS-HG700-11 (I think)
Campagnolo Calima C17 rear wheel
Shimano 11-30 cassette, 105 R7000

Shimano 105 GS long cage rear derailleur
Combination 1 + 2 is what came with the bike, and works fine. When I disassembled it, there was a shim between the largest sprocket on the cassette and the wheel side end-stop on the freehub body.
Combination 3 + 4 also works fine, without a shim, on the same bike without altering the adjustment of the rear derailleur at all.
However. I want to use the old wheel with the new cassette (1 + 4), indoors on a turbo trainer, and the new wheel and the old cassette (3 + 2), on the road.
Neither 1 + 4 or 3 + 2 works satisfactorily with or without the shim - either I can't get the nut thing to engage the threads to hold the cassette on, because the shim pushes the cassette too far out from the wheel, or without the shim the cassette is too close to the wheel and I can't adjust the derailleur such that shifting works with both wheels.
Questions:

Should I expect combinations 1 + 4 and 3 + 2 to work?
Should I need a shim?
If I do need a shim, is there a particular width or part number I need to look for?
Am I missing something obvious?

Thanks
Although the dimensions of the freehub may be the same, and two cassettes may have the same spacing. The hub dimensions will not be the same.
So the position of the freehub in relation to the frame is difference between wheels. A difference of just 1mm in freehub shift is massive in terms of the way the rear mech aligns to the cassette.
Similar issues have been noted when using direct drive traininers, the gears will be perfectly aligned to the cassette on the wheel, but when you mount the bike to the trainer, the cassette is in a different place in relation to the rear mech, so shifting is not correct on trainer.
There is no work around for this, every time you want to swap rear wheels, if the freehub is in a different position in relation to the rear mech, the shifting will be off and it will need to be re-aligned to the new rear wheel. This means that the old rear wheel will not be aligned anymore.
In terms of combination 1+4, there shouldn't be an issue here. It might be worth taking it to a mechanic to have a look. Without seeing it, it's hard to know what is wrong.
I suggest you make the bike work for when you will use on the road, so have the gears set up for the new wheel and old cassette (ie wheel 3 + cassette 2). And then just be aware that the shifting will not be perfect on the turbo traininer with the old wheel and new cassette.
Edit from comment
Thanks to Weiwen Ng for pointing that that the CS-HG700-11 cassette uses the &quot;10 speed&quot; freehub body. This explains why there is a shim where the 105 R7000 uses the &quot;road 11 speed&quot; freehub body. This could also factor into the shift of cassette cogs in relation to the rear mech.