If the cassette in question is a Shimano Hytrout a derailer to keep it precisely lined up. The chain would ride up and down that cassette at random, and when it moved onto a larger cog, it would sometimes pull the wheel out of alignment.
I tried to solve the problem by taking the cassette apart and just using a single hyperglide cog with spacers I salvaged off the cassette and a hardware store PVC, cut pipe, spacer. But no matter how much I tried keeping the chain tight, the chain derailed very often.
When I switched to a Surleycog made for use with hyperglide cassettes it worked beautifully - no more thrown chains. I read that other manufacturers have similar cogs that should work fine.