Accessing Native Array crashes unity

I have a simple script that loops through all selected units and requests a new A* path for each one.

However, upon creating a callback lambda without the ForEach loop unity crashes immediatly.

public void MoveUnits() {
Entities.WithAll<UnitSelectedTag>().ForEach((
                ref Entity entity,
                ref UnitFormationSize unitFormationSize,
                in int entityInQueryIndex,
                in Translation pos,
                in Rotation rot,
                in UnitSoldierSize unitSoldierSize,
                in UnitFormationSpacing unitFormationSpacing,
                in UnitSoldiersTotal unitSoldiersTotal
                ) =>
        {
            // There must be an AstarPath instance in the scene
            if (AstarPath.active == null) return;

           // Bunch of unrelated logic that I removed here for the purpose of this post.

            var p = ABPath.Construct(
                pos.Value,
                newPos,
                entity,
                path => pathQue.Add( (ABPath)path ) // This callback crashes unity
                // path => OnUnitPathComplete((ABPath)path) // I've also tried this variation
            );

            AstarPath.StartPath(p);

        }).WithoutBurst().Run();
}

This is defined in the same System class;

I’m using the A* Project Pathfiding Pro version.

I’m really struggling to figure this one out. Could someone give me a clue, please?

Gotta simplify: try reducing your pathing graph input to like the simplest thing possible: two nodes connected by a single path. Then complexify it to three nodes, all connected with paths. You might learn something interesting by watching the behavior. Can you breakpoint any of this code? (I ask because I haven’t done any ECS/Burst stuff). Does it loop endlessly or does Construct never come back, for instance?