Lets see the graph you have :
CREATE (a:Node {name: "A"})
CREATE (b:Node {name: "B"})
CREATE (c:Node {name: "C"})
CREATE (d:Node {name: "D"})
CREATE (e:Node {name: "E"})
CREATE (f:Node {name: "F"})
CREATE (g:Node {name: "G"})
MERGE (a)-[:HAS]->(b)-[:HAS]->(c)-[:HAS]->(d)-[:HAS]->(e)
MERGE (c)-[:HAS]->(f)-[:HAS]->(g)-[:HAS]->(e);
That is correct ?
Well then, the statement you wrote returns two paths ... sure, the visualization in the browser will show the full graph, but look at the other formats and you'll see you're getting two "rows" each containing a path.
You can see this by trying the following :
MATCH p=(n1:Node)-[*]-(n2:Node)
WHERE n1.name="A"
AND n2.name="E"
RETURN p LIMIT 1;
That will return only one path and the browser will show only one. It's just a matter of correctly interpreting/processing your results. This will show the second path only :
MATCH p=(n1:Node)-[*]-(n2:Node)
WHERE n1.name="A"
AND n2.name="E"
RETURN p SKIP 1 LIMIT 1;
Hope this helps,
Tom