[Layered Grid Graph] Agent walking on unwalkable area

Hello,

My agent seems to ignore the red blocks that I placed using a work item, i basically looped through all the nodes and for every node i checked its position against my grid system and checked if the height at that position is below zero and assigned it not walkable.

However even though the gizmos clearly show that the area is not walkable my agent still moves to it if the target is close to the shoreline: Astar Support - Album on Imgur

Any idea whats causing this? maybe the way i add the constraints is incorrect?
Heres the code

    private void ApplyNavConstraints()
    {
        LayerGridGraph gg = AstarPath.active.data.layerGridGraph;
        AstarPath.active.AddWorkItem(new AstarWorkItem(ctx =>
        {
            for (int z = 0; z < gg.width; z++)
            {
                for (int x = 0; x < gg.width; x++)
                {
                    GridNode node = gg.nodes[z * gg.width + x] as GridNode;
                    if(node == null) {continue;}
                    Vector3 nodePos = (Vector3) node.position;
                    SquareCell cell = grid.GetSquareCellFromPoint(nodePos.x, nodePos.z);
                    node.Walkable = node.Walkable && !cell.isWater;
                }
            }
        }));
        AstarPath.active.FlushWorkItems();
    }

Okay, Ive changed the code and dropped the AddWorkItem way of editing the graph since i realized the graph is layered and walking over the nodes in a ā€œ2Dā€ way doesnt make a whole lot of sense.
I instead used the documented GridGraphRule class and applied it to my graph using the AddRule method before scanning async using a couroutine.

The Ai still did the same thing, however after I applied a funnel and a raycast modifier it stopped walking into the water for some reason and walked predictably as its supposed to.
An explanation to this would be great but I suppose this will have to do for now.