"This doesn't happen in the timeline, only when I export. "
i had something like this recently.
vfx work done in After effects was popping to a different gamma,
even though the same codec had been used all along (i think)
the problem was ONLY visible in exports,
and not in FCP
my solution was to go to the QUICKTIME references,
and on the first, General, page,
at the bottom,
tick "Enable Final Cut Studio colour compatibility"
i don't know how this is supposed to work if i'm passing the file around.
and i don't know why it happens.
nick