First example works because you are adding the # after the link [[Anchor link#]]
But if you try to search for an anchor after the displaying text [[Internal links|custom display text#]]
it will return no results, because the # is interpreted as part of the displayed text.
You need to add the anchor after the link [[Anchor link#Heading 1| Some Text]]