Hi
When given a path request the package will try to find a path to the closest point to the target that it can reach. It will search up to A* Inspector → Settings → Max Nearest Node Distance world units away. So you can lower that value to make it mark the path as completely failed instead. Or you could use IsPathPossible.
That will not work at all. What you are checking there is “are all the nodes in the path I was given reachable from each other”. That is trivially true since you were just given a valid path with those nodes. What you should check is if the closest node to the agent and the closest node to the point you want to reach are reachable from each other.
GraphNode node1 = AstarPath.active.GetNearest(point1, NNConstraint.Default).node;
GraphNode node2 = AstarPath.active.GetNearest(point2, NNConstraint.Default).node;
if (PathUtilities.IsPathPossible(node1, node2)) {
// Yay, there is a path between those two nodes
}