The US tried this with their Venezuela raid. It resulted in a tanker almost hitting a passenger plane twice in two days. [0]
Turning off AIS while allowing civilian traffic is incredibly risky, and creating a huge no-fly zone in the Med is politically tricky.
[0]: https://edition.cnn.com/2025/12/16/americas/venezuela-near-c...