The description of the function FcFontSort states: "Returns the list of fonts sorted by closeness to p". So, if the font p is present among the set of the system fonts, this font should be in the beginning of the sorted list.
But in reality FcPatternEqual returns FcFalse if we compare the first element of the sorted list and the font p. The print of both fonts by the function FcPatternPrint shows that the fonts are similar but there are missed properties of the font p in the first font of the list.
The detailed bug description can be found at:
FcFontMatch and FcFontSetMatch call FcFontRenderPrepare, unlike FcFontSort and FcFontSetSort which do not. I've clarified this in the documentation.