Palestinians were free to travel through the Egypt-Gaza border. Plenty of TikTok videos of Gazans having trips abroad.
Even now, during the war, they can still leave but have to pay $7k in bribes, that's how Hamas leaders smuggled their families out or some actual terrorists left.