I was able to reproduce the described behavior.
These are all link types: Blocks, Cloners, Duplicate, Epic-Story Link, Gantt End to End, Gantt End to Start, Gantt Start to End, Gantt Start to Start, Parent-Child Link, Problem/Incident, Relates, Solves
It seems that Epic-Story Link
is handled like a super type of some of the other ones during query evulation. That's just a suggestion and I dunno why this should be.
However, the following query should work for your purpose
project = FOO AND issuetype = Epic AND issueFunction in linkedIssuesOf("project = BAR AND 'Epic Link' is not EMPTY")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…