Shortest Path between nodes excluding nodes with a certain label

We have a large network stored in v3.4.8 that incorporates nodes representing Companies and People. The edges between the nodes represent Appointments (i.e. Person 1 works at Company A).
Some of the People nodes are actually companies who function as if they are People (and are stored in the graph with a label of 'Is Company' = 1).

We are calculating the shortest path between companies using the built-in shortestPath cypher function -
match (start:Company {id:1}),(end:Company {id:100}), p = shortestPath((start)-[:APPOINTMENT*]-(end)) return *

What we want to do now is return the shortest path that doesn't involve a People node where 'Is Company' = 1.

I have tried using queries like where ALL(x in nodes(p) WHERE x.Is Company = 0) but performance is awful even with an index on 'Is Company'.

I needed to do a similar thing so I found on StackOverflow , the following solution.

The returned collection of paths does not contain any path that contains an Company node whose id is equal to 1:

MATCH p=allShortestPaths( (a:Company {id:1})-[*]-(b:Company {id:100}) )
WHERE NONE(x IN NODES(p) WHERE x:Company AND x.id = 1)
RETURN p;