I'd say that each scarab should be cut out separately, with a separate action + d4 damage. Also, slashing weapons should work as well but cause more damage, say d8.
"After this time, each scarab must be cut out as an action with a piercing or slashing weapon, causing 1d4 piercing or 1d8 slashing damage to the target and killing the scarab."
I'm not so sure about the rapid reduction to a skeleton effect. I'd just as soon leave the defined six-second duration out of the stat block, because it genuinely doesn't make sense for a single scarab beetle to be able to potentially reduce a human-sized corpse to a skeleton in six seconds.
Overall though that swarm is terrifying.