Some people have more than one passport (multiple citizenship) and could use a different one to enter different countries because of visas. The name could be partly different on those passports. But yes, they probably know the passport they'll use since the time they buy the ticket.
I as an example have 2 passports, and my name is first middle1 middle2 last.
One of my passports has my name like that, the other is first middle1 last, so even between passports its not the same, as one of them drops one of my middle names.
I know people hate the idea of all three of world government, government IDs, and reducing people to numbers, but things would be a lot easier if we could just write on forms "I'm person number 15389247652" and let name matching be relegated to historical documents.
As you hinted, we would need a global authority recognized and trusted by everyone at least for name registration and resolution.
About government IDs and reducing people to numbers, most of the threads here are already giving them for granted. We are a number once we're in a database.