With spells is really simple (as many other have already said).
The right illusion can simulate all the execution, gallows and guards included.
Or simple trickery and corruption.
And do not forget that a simple hood for the convict can go a long way. You show the face once at the audience and then hood him. So.. if the hanging was fake the criminal don't need high acting skills to fool the people watching and if magic was involved no worries, the end of polymorph or other spells will be discreet as long as the spell only altered the face of the convict.
The right illusion can simulate all the execution, gallows and guards included.
Or simple trickery and corruption.
And do not forget that a simple hood for the convict can go a long way. You show the face once at the audience and then hood him. So.. if the hanging was fake the criminal don't need high acting skills to fool the people watching and if magic was involved no worries, the end of polymorph or other spells will be discreet as long as the spell only altered the face of the convict.