Hamas’ headquarters is a legitimate military target regardless. Israel has the right to fire on it, and destroy it, no matter who is in the way.
When Hamas uses doctors as involuntary human shields, that is an atrocity by Hamas, and siting their headquarters in a hospital was an atrocity by Hamas. If involuntary human shields die in the process, they were murdered by Hamas, just as when a kidnapper uses his victim as a shield in a gunfight with the police, and the police shoot at the kidnapper and kill the hostage, the kidnapper is guilty of murder. The police are guilty only of poor aim, which is not the same thing.
If the doctors volunteer to be human shields, and die in the process, their blood is on their own heads, and there is no atrocity.
Note that if their cooperation is coerced by Hamas (”stay here or we’ll kill your whole families”), that is an atrocity by Hamas, and, if they die, they were murdered by Hamas.
The people cheering the dead hostages might be similar to the Norks making a big show of crying and beating themselves when “Dear Leader” dies.
Israel needs to do it like Cortez defeated the Azteks, and get the locals to help.