I find my ultrasonic cleaner (a reasonable one with heating, not just a cheapo jewelry plastic one) is no good on the cassette. There’s just too much gunk to come off. I’ve tried !
I now keep the ultrasonic bath for the chain cleaning – and that’s after soaking the chain in some white spirit and agitating (I’ve a few old Douw Egberts coffee jars as the push-on lids seal well).
I use some white spirit and a stiff-bristled brush for the cassette. Then rinse with water then squirt for IPA (not the beer) to get it to dry quickly.