I don't think that would work simply because after that person spends the $5M, the government can't claw it back even if that person commits another crime, and if they are in the state where they are considering another crime, the extra $5M debt would probably not deter them too much. This proposal would need to be reworked to align long term incentives of the person with not committing another crime. It would also need to disincentivize people from committing crimes just so they can get this benefit.
In a somewhat related vein, I recall there being a proposal to provide basic housing to the chronically homeless, as certain homeless people cost the taxpayers millions due to arrests and illnesses from being homeless. Although there is no angle of punishment here, there is still the angle of those homeless not deserving free housing. I believe however that there is a strong case for providing such housing, when viewed from a dispassionate point of view, as it is both fiscally prudent as well as humane in reducing suffering.
In your scenario you are adding an incentive to a single commit murder. You are trying to make the point justice is not about utilitarianism but about morality on some level - but your example is so unmoored from reality that it is useless.
The only real reason to object to it would be problems unlisted in this analogy - like the obvious incentive to murder. But we're axiomatically handwaving those intuitive signs of a bad choice away due to a "those turn out to not be an issue".
The problem here is your conclusion ("yes this may look good on paper but your gut instinct clearly tells you this is a bad idea regardless") is based on using your gut instinct, in a hypothetical that axiomatically requires you to ignore your gut instinct. In other words, you're breaking your own rules.