In sefer Ezra 6:11 it tells us that King Darius decreed that anyone who attempted to disrupt the resumed construction of the beis hamikdash would have a beam removed from their home and they would be killed with it.
This is very similar to what had occurred to Haman and his sons about whom it says that they orchestrated the "stop work order" on the rebuilding of the second beis hamikdash which was issued by Achashverosh.
The Midrash Panim Acheirim as well as the Yalkut Shemoni seem to say that Haman and his sons were killed in that manner because of this warning issued by Darius.
My question is, how could it be that Haman and sons were punished in a manner that was described after their death. Since Darius is known to be the son of Esther (see Vayikra Rabbah) and therefore would have been king many years after Haman's pdeath.