In the comments to this question I learnt that
明日、林さんに会うときに、この本を返そう
and
明日、林さんに会ったときに、この本を返そう
have the same meaning, although 会った is more common.
With my current understanding, that the tense in a subordinate clause is relative to that of the main clause, I would have expected 会った to be the only correct choice, since I cannot return the book to 林さん before I've met up with him.
I was advised to post a separate question about this, so here it is. Could someone please explain how these sentences can have the same meaning and how it fits in with the relative tense rule.