Under US Immigration laws the steamship companies were legally responsible for every passenger who boarded one of their ships. The steamship companies knew the medical and financial requirements that the US government had because they would be fined $100 (current value is $3,000) if one of their passengers was rejected in the US. As a result there were very careful screening of boarding passengers in the European ports. Hamburg and Antwerp both have museums that document the process.
One of the most frequent causes for exclusion was if the passenger had a "loathsome or contagious infectious disease." The companies had a whole retinue of doctors and medical tests that every passenger had to pass prior to boarding. A possibility is that one of the party was ill or had a condition that was excludable and the Latvian inspections were very thorough. If was something short term they could have gotten over it on voyage to Trieste or they decided to make another attempt and conceal the problem.
If you look at the manifests of arrivals at Ellis Island there are some codes that indicate the reason for detention and exclusion. Look carefully at the original manifest and see if there are any clues. Also have a look at the arriving manifest in the US, the problem might have persisted and dealt with in the port of entry.