10-speed shifters work with one wheelset but not with another
It's very likely that an 11 to 10 speed cassette spacer was used on the 11spd wheel that's not exactly the Shimano-specified 1.85mm thickness.

There's some range in what thickness of spacer will physically do the job. For example, people are always using 1.8mm Mavic cassette spacers for Shimano for the purpose, which works fine as long as you're not swapping wheels. But the 11 speed Shimano freehub was designed to have a 1.85mm be the size to create interchangeability with 10 speed native hubs.

If for some reason the hubs locate the cassettes differently even with the correct spacer, that would be surprising between two Shimano road hubs, but by the same token you could potentially use spacer tricks to compensate.

Once the cassettes are located right, chain/cassette wear and is worth looking at next. Wear can have enough of an influence on shifting ability to cause these problems. It's possible but not likely for it to be the decisive factor.