Foreign ministry spokesman says action against ship which had been held by Gibraltar would be a mistake with grave consequences