When something moves only under load, it is either a loose something (including bad fit) or a broken something. You've got a cassette, freehub, chain, derailleur, chainset, pedals, bottom bracket and frame. You said you'd eliminated the chain, so that leaves the other items. You can probably eliminate the derailleur because it isn't under tension. A broken axle in the rear freehub can continue to operate normally if under sufficient pressure from the quick release while still shifting suddenly under high tension but you said you'd tried a different wheel so that eliminates a broken axle as the problem (assuming you don't have two broken axles). The cassette is new so that shouldn't be the problem. That leaves the chainset, pedals, bottom bracket and frame.