They have control of the ship, but the ship doesn't own the cargo! It's not legally theirs to sell.
As staff who are presumably looking to eventually get another job in shipping, they have to follow the rules even if it's not clear what they are or the owner isn't following them.
The fact that the cargo is sanctioned makes it even more likely that a port will say "we're not touching that".
The "flag of convenience" situation .. well, it's a great way of evading legal responsibility, but it's also a very old one. That's going to persist for some time to come.