Thanks, Kimmo & Xenologer.
To report the final outcome: maybe I'm just lucky, but putting cogs with neighbours they were not meant for (but of the same brand) has worked out for me.
My Frankenstein cluster of 7 used Shimano 9-speed cogs (all from one cassette and in their original order), 6 8-speed spacers, and a new Sunrace 8-speed 12T was working fine. But getting a new chain prompted me to take a closer look at the used cogs. They proved to be visibly worn, and I had replacements available in two Sunrace cassettes, so I decided to try out an all-new, all-Sunrace mix.
It is working well, even though the three smallest cogs do not have their original neighbours. Here are the source clusters, with the cogs I'm using in bold:
12-13-14-15-16-18-21-24 11-13-15-18-21-24-28-32
Weirdly, the only shift which is noticeably balky is from 18 to 16 - although those cogs were neighbours in their source cassette. The 16-14 and 14-12 are fine.
The moral, I guess, being that it may be worth trying out mixed cassettes, with the question of whether sticking to one brand helps left open.