Get a chart of the SoH.
When you transit SoH you can see land on both sides.
Oman to the south and Iran to the north.
You are in Iranian or Omani territorial waters exercising the right of free passage.
Short of actually firing - it’s their legal territory.
Note: This article is BS. This happens all the time...
Meanwhile, an average of 13 loaded oil tankers transit through the strait every day, and there are numerous naval assets in the area, not just the US Navy, determined to see that the strait stays open.
If Iran would attempt to block the strait it would rapidly lose its navy and regret its impulsiveness.
ran Announces Long-Range Missile Test Amid Strait Of Hormuz Row With U.S.