According to the neo4j documentation:
CREATE UNIQUE is in the middle of MATCH and CREATE — it will match what it can, and create what is missing. CREATE
Here is how you can do it with CREATE UNIQUE
MATCH (a:Person {name: 'Alice'}), (b:Person {name:'Bob'}) CREATE UNIQUE (a)-[:knows]->(b), (b)-[:knows]->(a)
You need 2 match clauses otherwise you are always creating the node in the CREATE UNIQUE statement, not matching existing nodes.