Whenever the player is given temporary command of another ship, the traits are all reset and are not put back after the player's original ship is returned to their control.
Spoiler Warning for "Temporal Ambassador"
In this example during "Temporal Ambassador", when given command of the Enterprise-C, the traits are all reset (except for my class specific one).
Comments
Yes very annoying bug
It's looking like it's whenever you're temporarily given another ship, I haven't checked them all but I suspect it's the case.