This is very similar to Do the Armor of Agathys and Mirror Image spells stack, so that hitting an illusory duplicate still causes you to take cold damage?, but I believe this reasoning no longer applies to the 2024 edition of the rules.
The Mirror Image spell description (2024) states (PHB, p. 299; emphasis mine):
Each time a creature hits you with an attack roll during the spell's duration, roll a d6 for each of your remaining duplicates. If any of the d6s rolls a 3 or higher, one of the duplicates is hit instead of you.
(Note the change from the 2014 version, which starts with "Each time a creature targets you with an attack".)
The Armor of Agathys spell description states (PHB, p. 243; emphasis mine):
If a creature hits you with a melee attack roll before the spell ends, the creature takes 5 Cold damage.
This is very similar to the Abjurer's Arcane Ward feature which is also providing damage redirection and is believed to "stack" with Armor of Agathys:
Whenever you take damage, the ward takes the damage instead
So: is it possible to redirect a melee attack to an illusory duplicate in such a way that caster takes no damage but the attacker is punished with the cold damage?