As George said it can very much be up to a ticket or gate agent.

Good friend of mine, family of six, three generations, were denied boarding by JetBlue earlier last summer in Fort Lauderdale. Destination: Turks and Caicos. Ticket counter agent flat refused to issue a boarding pass of one of the grandmothers when her valid passport had five months left before expiration even though it was a six night stay with confirmed returni ticket.

No chance that she would overstay a vacation trip with family! But guess who had the final stay. They had driven five hours that morning to FLL. They couldn’t just leave her there, so all returned home, trip ruined.

I wouldn’t take the chance of losing thousands of dollars based on a <$20/hour employee's interpretation of a foreign countries's rules.