NDVI values outside the [-1, +1] range

I have been using SNAP to process NDVI.

Recently, I detected NDVI values outside the [-1, +1] range. For example T29TNG 2022-11-05.
The NDVI was calculated using the SNAP desktop by choosing the L2A product and selecting Optical → Thematic Land Processing → Vegetation Radiometric Indices → NDVI Processor.

Is there anyone who had a similar situation?

Hello DCraveiro,

this is indeed an issue int the NDVI operator.
I have saved it in our error database.
[SNAP-1582] NDVI operator does not consider valid pixel expressions - JIRA (atlassian.net)

It is possible to work around this problem.
On the resulting ndvi image a valid-pixel expression (ndvi>-1.0 && ndvi < 1.0) can bet set to exclude such out-of-range values.

But this leaves the area where both input bands are marked as invalid with values equal to -0.0.
So, to finally work around this issue it is better to pre-process the bands.

Use the band maths to replace the invalid values by NaN.
Expression for B4: B4.raw > 0 ? B4 : NaN
Expression for B8: B8.raw > 0 ? B8 : NaN

The resulting bands can then be used as input to the NDVI processor.

There still might be values out of range but these are values where als the inputs are strange, e.g., negative reflectance value.
It is possible to filter these in the pre-processing stepp too. The expression should look like this.
B4.raw > 0 && B4>0 ? B4 : NaN
B8.raw > 0 && B8>0 ? B8 : NaN