Agreed it's sloppy coding.
Here's my guess: it's probably because you can have multiple people on one reservation. Each passenger on the flight gets an ID, and each reservation contains the IDs of the involved parties. Invalid reservation ID? List all the passengers, obviously!