Used cassettes, sight unseen, probably are a risk. But if you can examine them closely, or even better with a Rohloff cassette checker, many of the individual cogs might be OK.
FWIW, in building up custom 8-speed cassettes from loose cogs with 7-speed/Campagnolo spacers for Sachs New Success Ergo brifters, I’ve used 9-speed outer (smallest) and occasionally second cogs to reduce the cassette overall width. Shifting seems unaffected.
I mix Shimano, SRAM and Miche cogs for those cassettes. Only times it matters is for the cogs with single tooth jumps, which always work better if they are “matched”.