Please take a look at a map. It left Vishakapatnam in the Bay of Bengal on the 25th three days before the war started and was sunk outside the territorial waters of Sri Lanka off Galle in the south of Sri Lanka, about 500 km from the nearest Indian port.
It was in Vizag between Feb 17-25 for naval exercises along with ships from 50+ countries and social media accounts had widely noted its visit. It was no secret when and from where the ship left India.
No responsible official from Iran has even hinted that India was somehow responsible for the ship sinking, but some people here seem to be more loyal than the king.