More than 2,000 Palestinians returning from the annual Hajj pilgrimage have been left stranded on boats off the Egyptian coast after Cairo denied them permission to return to Gaza.