It was on a heist mission to get the prism, taking a detour and causing a highly visible ruckus that by all rights should be talked about up and down the sword coast seems like a super dumb idea.
Unless this WAS the heist mission.
If the Prism Heist was occuring in Baldur's Gate, then swooping in and taking it before the Gith get their hands on it would be considered worthwhile, despite the problems it that its noteriety would cause.
Firstly, that city is actually confirmed as being Yartar, not Baldur's Gate. That confirmation was from the devs, not the game so I don't blame you for not knowing that. If it were Baldur's Gate, then the writing would be even worse because A) why would they need to send a nautiloid to get it given they're already based in the city and B) no one in the city ever talks about the nautiloid, which would be insane given the chaos of the attack.
Beyond that, it's been a long while since I played so maybe I've just forgotten, but wasn't it explained that the prism was stolen FROM the gith? That's why the gith are after it, it was stolen from Vlakith. And the reason Shadowheart is so anti-gith is that the rest of her people who also went to steal the prism for their own vague reasons were killed by gith on that mission. In which case they're attacking the city after they already successfully had the artefact.
It also doesn't make sense why they'd have untadpoled prisoners on the ship either.
It grabbed them during the attack. You literally see it in the cinematic, the tentacles slap bunches of people and they get poofed into the pods.
Thus, it's highly likely that this is where the Origins/Tav get picked up. Them being random bystanders who simply happened to get grabbed during the attack (With of course Karlach/Wyll coming from the brief jaunt in Avernus)
As for why grabbing random people?
It could be a way to mask the real reason for the attack. If you make it seem like just a random abduction attack then you don't raise the suspicions of the Gith about the fact that you were directly targeting the Prism Heist (Which seemed to have worked because the Gith had no idea that the crashed Nautiloid contained the Prism and that survivors of the crash would carry it directly to them)
I was talking about Ixal's suggestion that the party was brought along onto the nautiloid before takeoff. I understand why there would be people there after the attack. Though since they didn't attack Baldur's Gate, that still makes Astarion's presence inexplicable.
And finally, the gith specifically do know that the nautiloid contains the prism. That's why we meet the gith patrol in act 1. They're specifically looking for it in that area because that's where the nautiloid went down.