Column Label in a SUMIFS function gives an Err:502

I am struggling with a strang Err :502. The following function
=SUMIFS(‘Net’;‘Compte’;$D$2;‘Rentree’;"<="&F4) results in a Err:502 on one spreadsheet and not an another with column labeled exactly the same.
If I replace in the formula the column labels by actual cell range references (ie D10:D1000), the formula works fine.

Any idea where it might comme from?

Please @yvnicolas, verify if you have the labels range defined in Menu/Insert/Names/Labels

Calc has the feature of auto detecting column or row labels. It is set in Tools > Options > Calc > Calculate. This setting is stored in the document. So perhaps it is enabled in one document and not in the other?