It's not a dumb question. In mechanical systems the indexing (ie by how much the cable is pulled) is done at the shifter. The derailleur design then has a "leverage ratio" which determines by how much the derailleur arm will move laterally for a given cable pull. The amount of lateral movement needs to correspond precisely to the lateral spacing between the rings on the cassette, Naturally Shimano and Sram choose to use different ratios at both the shifter and derailleur! So you can't just mix and match between shifters and derailleurs from the two brands.
However, what's key here is that (whatever the brand of shifter/derailleur) the derailleur arm moves laterally just the right amount for the cassette. You could try putting the 27.5 wheel on the 29er bike and seeing if the derailleur movement works across the whole cassette. If so, then it should also be OK with the other configuration. However, you will probably need to reset the end stops of the derailleur to match the cassette when you swap.
I don't have experience with electronic shifters, so others here might be able to confirm or refute what I've just said, but the principles are the same.