The question "Who dies instead of Hamlet?" contains a misunderstanding: Hamlet does die, mortally wounded by Laertes' poisoned blade in the final duel. But the play's body count extends far beyond the prince—each death a ripple from the central corruption.
Driven to madness by Hamlet's cruelty and her father's death, she drowns—likely suicide. Had Hamlet not feigned madness or killed Polonius, she might have lived. She is collateral damage of his performance.
He dies by his own poisoned sword, turned against him by Hamlet. Without Claudius's manipulation, Laertes would not have sought a rigged duel. He is a victim of the king's scheming as much as Hamlet's skill.
The usurper is Hamlet's true target. Had Hamlet killed him at prayer (Act 3.3), the Act 5 bloodbath might have been averted. Claudius's survival is the engine of the tragedy.
She drinks the poisoned cup meant for Hamlet—accidental but inevitable in a court where poison circulates like wine. Hamlet's failure to confront her earlier leaves her exposed.
Childhood friends turned pawns, executed in England on Claudius's orders. Their fate underscores the play's grim lesson: in a rotten state, loyalty offers no protection.
No single character "dies instead of Hamlet." The tragic structure demands a multiplicity of deaths. Hamlet's delay, Claudius's corruption, and the court's rot ensure the body count extends far beyond the prince.