While I don't condone violence, it's a legitimate way to defend against occupation.
Targeting civilian homes and a festival - nothing legitimate about that.
That said, it is almost impossible to imagine that the Israeli response would have been something lesser than the current genocide attempt if Hamas had just taken POWs during the October 7 attack. Bibi would have arguably been even more humiliated if Hamas had been acting with restraint, so the impulse for revenge would be even greater.
It is almost impossible to imagine Israel would even look at the direction of Gaza had they just taken the statehood offers presented to them in 1947, 2000, 2001, or 2008, instead of repeatedly choosing terrorizing civilians over gasp compromising.
It's very much possible to imagine that.