If it’s a genocide, then why are allies of Palestine refusing to let them leave?

So when I'm watching a holocaust movie, at no point ever am I like "No! Don't let the Jews leave! It will be harder to come back!"- No, instead I'm like "it's a genocide, get the F out of Germany until he Nazis are gone"

So if there's a genocide in Gaze, why do Hamas, their allies, and Pro Palestine movements all side with not allowing civilians to flee the genocide? At that point aren't they just sacrificing human lives for land?

Or is it because they know that if all the civilians leave, then Hamas won't have anywhere to hide?

Genuinely curious how people who think it's a "genocide" square this up?