Hi Glenn, Bart here. I can explain international maritime law to you, and maybe you would then understand that freedom of navigation does not apply to stateless ships. This vessel is stateless as it was flying the flag of Madagascar but was not registered there. The reason? Because normally the flag state would be responsible for safety, security, and labour laws on board a ship. As the vessel is stateless, there is no flag state. As such, a port or coastal state has the authority (given by UN international maritime law) to board and detain a vessel to ascertain the nationality and basically act as a flag state. The coastal state is allowed to enforce these laws in international waters (the coastal state becomes the de facto flag state).
Why would we allow such a thing?
You see, when a ship would ground, sink, and/or get damaged and oil would spill on our coasts and kill birds, destroy the livelihood of fishermen, the tourist industry, and destroy nature, the insurance of the vessel would pay for the damages. As the vessel is stateless, there is no insurance company. So if a vessel were to flounder, the cost would fall on the citizens of the coastal state that got hit by the oil spill and not the shipping company. That's why, when UNCLOS 82 was negotiated, a lot of countries made sure that there were provisions so that a coastal state could take these vessels and remove them from our seas.
Now, concerning sanctions.
Of course, you can not enforce them in international waters on a ship flying a foreign flag. You would only be able to enforce those if the ship were flying the flag of your own country and/or if the ship were to sail in your territorial waters. (A vessel sailing through your territorial waters has to adhere to the laws of the coastal state and, as such, adhere to any sanctions, even unilateral sanctions.) But here's the thing. As I explained before, there is no flag state, so the coastal state has become the de facto flag state of the boarded vessel. And guess what... now the vessel has to adhere to unilateral sanctions.
I'm really happy I could explain this to you. Best regards