Back in 2018, Hamas orchestrated (well, hijacked) mass protests along Gaza Strip's border with Israel. One of the most controversial tactics used by the IDF at the time was sniper fire against main instigators for violence in the crowd, those suspected of carrying arms, and those coming too near to the border fence (no full wall back then). The result was, of course, many more Palestinians dead and wounded.
Israel's reasoning for choosing this tactic was that non-lethal means available were not effective for 'events' of this scope, and that the main concern was that a group of protestors allowed to rush the fence could result in a stampede possibly resulting in penetration and chaos. This was seen as both a major risk of the settlements located really near the border (one of the protestors' chants of choice was 'we'll meet at Netiv HaAsara' - a village just on the border), and as potentially leading to more Palestinian deaths as well (if troops had to use live fire at closer range).
So anyway, back then there was a lot of criticism about this tactic - both abroad and within Israel. On this forum as well. Post the 7/10 attack, maybe the decision taken back then wasn't a wrong one.