Thanks for your work Badunit.
Following that I made another attempt.
I'm going to avoid to use the word "date" because there are no dates at all anywhere in this whole table nor in the discussion.
Here is what I set up:

Column A is just the numbers, no custom format.
Column B is the numbers that I want to add up with SUMIF
Column C is the same as A, i.e. numbers, but displayed with the conditional format that puts the hyphens in:

As you see, the type is Number.
Column D has values that will be used in the conditions of the SUMIFS. Two are not formatted (D10, D11) and two are formatted (D17, D18).
Column E has several SUMIFS, all of which should give the same result.
For clarity, I have also pasted their formulae as text in the adjacent cells in column F.
First, E13 shows 0 (zero), it gives no error but the result is completely wrong, as you also pointed out. Very dangerous!
E14 works, because the condition is now made up differently, but I fail to see why it should be different.
E15 uses the column with the formatted numbers and is still giving the right result (as you also pointed out), but it still uses the condition values like in E14, i.e. they are built-in numbers.
E17 goes wrong but does at least tell me it does. It uses the condition values from the formatted cells.
E18 is correct, but it uses the condition values from the unformatted cells D10, D11.
It seems therefore that the problem is narrowed down to the way SUMIFS interprets the cells referred to in the conditions. It takes the formatted text, not the value. Therefore it works if the cell displays a character string that looks like a number but not if it contains the hyphens. (there must be a lot of guessing going on behind the scenes for it to come up with the report that I'm trying to compare with a date!)
Of course I do not care about what Excel does. The majority is not always right, and compatibility is also sometimes a way to stagnate.
(rhetoric questions:)
First, it is somewhat strange but understandable that the condition must be a string, however what is the difference between F13 and F14?
Second, in F15 and F18, why does it take the values of the data in C but not the values of the cells D17, D18 ?
What is needed is a function VALUE(cell reference) which explicitly ignores the formatting.
Sometimes formatting is needed, e.g the function LEFT(cell,n) must work on the character string of the display, not the value.
I can of course work around the problem by using a complicated string function to convert D17's display string back into a string without the hyphens. But given the number of sheets and tables I have (hundreds) that use this custom format and do SUMIFS with conditions taken from other (often computed) cells, this is not an option.
For the time being I'll stick to Numbers 2.3, which is also much more comfortable to use on large spreadsheets, and in parallel continue to work on a JavaScript/php/HTML alternative that will do a better job of separating value from format. (one of the things I'm putting in that alternative is the possibility to write a single formula for a whole column, so that I don't need to propagate when a change is made)
Thanks for your efforts, they helped narrow down the problem.