It took them years to prepare that operation. It was against Hezbollah, not Hamas, because they saw them as the bigger threat.
The war in Gazah is barbaric, but the sensible immediate alternative would have been a very targeted operation to find and rescue the hostages, not something like this.
Historically Hamas has been the amateurs and Hezbollah the pros. Hezbollah has actual victories against the IDF. Hamas' military success last October was completely unprecedented. Its generally believed that Hezbollah trained Hamas into the fighting force it is now. And since Iran trained Hezbollah you get people claiming Hamas is an Iranian puppet.