Wheels need a service – pretty easy but need some skinny spanners.
I’ve had the cassette thing – first time the freehub had worked loose from the body of the hub (its a big 10mm allen key behind the axle bearing assembly, well it was anyway).
2nd time i managed to crack the freehub in half and rip the spline off the hub. That time the freehub spun on the hub, and the cassette fell off as there was no tension the threads 🙂
I’d strip the hub, take the freehib off, check the threads and palws on both hib body and freehub, clean, slither of grease and reinstall if all ok.
clean an check threads on cassette locking and freehub, and check the cassette is seating down properly so the lockring is threading down enough to hold it. You shouldnt need locktite.