I’m not familiar with Trimethylaminuria but according to rarediseases.org, it “is a rare disorder in which the body's metabolic processes fail to alter the chemical trimethylamine. Trimethylamine is notable for its unpleasant smell. It is the chemical that gives rotten fish a bad smell. When the normal metabolic process fails, trimethylamine accumulates in the body, and its odor is detected in the person's sweat, urine and breath.”
So perhaps it could be advantageous in an environment with would be predators. Horrid smells are typically a deterrent.