A legal analysis published in [just security](https://www.justsecurity.org/133397/sinking-iran-frigate-dena-law-naval-warfare/), from authors that are evidently quite sympathetic to the USN but not quite ready to just outright lie, contains the following discussion
> "After each engagement, Parties to the conflict shall, without delay, take all possible measures to search for and collect the shipwrecked, wounded and sick, to protect them against pillage and ill-treatment, to ensure their adequate care, and to search for the dead and prevent their being despoiled."
> The Convention expressly extends the protection to enemy forces who are shipwrecked (art. 12).
[...]
> [The commanders handbook on the Law of Naval operations states]: "To the extent that military exigencies permit, submarines are required to search for and collect the shipwrecked, wounded, and sick following an engagement."
[...]
> With respect to submarines, [ICRC commentary on the 1949 Geneva convention] points to the fact that “space is extremely limited on board a submarine, thus complicating their ability to take on board shipwrecked, wounded and sick, let alone dead, persons” (¶ 1637).
> However, the Commentary emphasizes that this does not exempt the submarine from taking other reasonable steps to help the shipwrecked crew of an enemy warship. For example, it points out that, depending on the situation, submarines might be able to “supply materials such as lifeboats, survival craft (including inflatable rafts), buoyancy aids, alert aids, detection aids, food, and water.”
[...]
> Whether the Charlotte (and U.S. forces more broadly) complied with these obligations depends on facts that are not fully available in publicly available sources. What we can say is that the submarine was under a legal obligation to take feasible measures to rescue those who were shipwrecked.
They then decline to discuss if there existed any actual reason making providing aid unfeasible, instead quietly pretending there definitively was some military threat preventing surfacing and thus don't have to conclude the USN ship failed to perform its duty.