That is a serious failure!
It happened to me on an 11-week old Whyte T130 C RS. I took similar pictures and could not see what was holding it on, or even what was transmitting the drive to the wheel except friction. I rang up the workshop of the LBS (Rutland Cycles) and spoke to the technician there. He too was puzzled and I texted him the pics.
I checked the dropout alignment (spot on). Checked the Maxle diameter, (fine, not tapered). Checked whether the cassette was properly secured (yes).
Eventually he told me that the hub axle had sheared and the sheared faces had been polished by rubbing together so that they looked like machined surfaces.
The bike went back and when I collected it I was told that the alloy hub axle had been replaced by a steel one. They had a complete steel hub axle available because it was fitted to the cheaper models.
This was the full program of work, so make sure that yours gets similar treatment.
The complete freehub was replaced and all bearings, seals, pawls springs etc. The hub axle is now steel (painted black). The Maxle was also replaced and was reset to give the correct clamping force. That took less than a week, including ordering parts and waiting for delivery.
Poor show by Whyte, but great service from Rutland Cycles. I have had no further problems with the back end of the bike.