Ok, I give you benefit of a doubt that you did not think through this analogy. Let’s go in details. Step by step.
Suppose that a person X of some nationality makes some demands, like remove government and release all prisoners, and while doing that, kills somebody and hides in the city while being armed threatening to kill more if police comes for him or the demands are not met. What normal civilized response of the state would be and would not be?
It definitely would not release prisoners, nor remove the government. And it would not be “do nothing” because in the city there are other civilians who might suffer when the person X is apprehended. It would neither be let’s kill people of the same nationality.
So, instead the police would hunt and try to apprehend or kill him while minimizing civilian casualties. But civilian casualties are quite possible.
This is exactly what Israel is doing. It goes after Hamas. It does not go after Arabs because they are Arabs (in sharp contrast to what Hamas did - killing Jews because they are Jews). And Israel does minimize casualties, but it is just not possible not to have casualties at all (this is where analogy breaks, sometimes criminals are apprehended without any inconvenience to public).
Yielding to Hamas demands would be mistake for the same reason why it would be mistake in analogy. Doing nothing would be also a mistake, also, for the same reason as in analogy. The guilty should be apprehended/killed if resists while minimizing civilian casualties - true in both cases.
I will say even more. When Hamas was planing this, it perfectly understood, that it can not win war with Israel, and that Israel will retaliate with many civilian casualties in Gaza. While Israel essentially does not have a choice in its action, Hamas did. And yet it decided to kill 1000+ civilians inviting death of civilians in Gaza precisely for the reason of many posts appearing on internet “ah, poor civilians, look, Israel is bad”. This is Hamas making, not Israeli.