Not to the French-they could have cared less. And d'Enghien was committing treason by being in the pay of the foreign power which was at war with France at the time.
While it may 'stink' by current day pseudo-'standards' of justice, it didn't by the times.
To coin a phrase, 'life's rough-then you die.
I would wager that if the British government of the time, or any other in Europe, had done the same thing, you wouldn't be complaining about it. Your objection, it seems to me, is Napoleon, not the 'affaire d'Enghien.'