Some people claim they do not notice poorer shifting with mismatching chain and cassette manufacturer. I do not know how that is possible, in my experience any mixing of 3rd brand stuff does affect shifting. Worst ones imo have been Garbaruk cassettes with any chain.
Though some people mix and match Shimano chains with Sram 12 speed cassettes too and vice versa, they seem to shift really poorly when test riding these customers bikes. Personally I would not do that, especially Shimano systems really do work poorly if the chain and cassette do not match. But this is all based on other peoples bikes, I do not like to mix on my own bikes – only time I did was put a Wipperman chain on a Shimano 11-cassette, and that has also been the only chain I snapped in years. I suspect the shift ramps on the cassette did a number on the chain not shaped to work with those, as it also was not shifting up as smoothly as a Shimano one.
As an aside, Sram chains on the top end last a lot longer than any other mtb chain.