I would recommend changing from ERA-Interim to ERA-5, since ERA-Interim will be outdated soon. This is the information currently given by the data provider:
ERA Interim is being phased out. Users are strongly advised to migrate to ERA5. The last date to be made available in ERA Interim will be 31 August 2019, which will be released at the end of October 2019.
It would still be good to solve the issue you are currently having with ERA-Interim.
[...] some grid cells over land have sea-ice information. Not a big issue so far, because spatial discretization must always lead to some discrepancy in land-sea mask. [...]
As you mention, spatial discretization can lead to discrepancies. Do you use the land-sea mask from the data provider? If the land-sea mask is given in a fraction, you would have the possibility to put a threshold on the land-sea fraction and thereby filtering out "coastal" gridpoints. The best value for this threshold depends on your application.
[...] But these specific grid cells, those closest to the coast (or even on land) show very weird values sometimes.
Is the dataset conforming to the CF conventions? If so, the variable considered most likely has a valid_range attribute. There are specific rules specified how software should treat the data. You should check that your software adheres to these rules. Inspecting the data with another software package can be helpful. If this does not solve the problem, I suggest contacting the data provider, since there might be a real issue with the data that they should be aware of.