You can also gauge the level of IDF casualties by considering the fact that Israel had resorted to the use of foreign mercenaries. Spanish and Ukrainian private contractors openly revealed themselves on video as fighting for IDF in Gaza.
Though, I don't believe the retreat of IDF brigades is necessitated by or indicative of casualties if taken into consideration the idea that Israel waged war on the pretext of Gaza's (not Hamas') destruction. If that is correct, IDF has done a great job of making large swaths of Gaza inhospitable for decades to come. This idea has tons of evidence corroborated by Israeli leadership from all ranks of politics to military.