Method for obtaining adjacent chunk positions
Well, I suggest next approach

        if (tileX != 0 &amp;&amp; tileY != 0 &amp;&amp; tileX != chunkSize - 1 &amp;&amp; tileY != chunkSize - 1)
        {
            return;
        }

        var leftChunk = tileX == 0;
        var rightChunk = tileX == chunkSize - 1;
        var downChunk = tileY == 0;
        var upChunk = tileY == chunkSize - 1;


        if (leftChunk)
        {
            chunksToUpdate.Add(new Vector3Int(position.X - chunkSize, position.Y, position.Z)); // Left
            if (downChunk)
            {
                chunksToUpdate.Add(new Vector3Int(position.X - chunkSize, position.Y - chunkSize, position.Z)); // DownLeft
            }
            else if (upChunk)
            {
                chunksToUpdate.Add(new Vector3Int(position.X - chunkSize, position.Y + chunkSize, position.Z)); // UpLeft
            }
        }
        else if (rightChunk)
        {
            chunksToUpdate.Add(new Vector3Int(position.X + chunkSize, position.Y, position.Z)); // Right
            if (upChunk)
            {
                chunksToUpdate.Add(new Vector3Int(position.X + chunkSize, position.Y + chunkSize, position.Z)); // UpRight
            }
            else if (downChunk)
            {
                chunksToUpdate.Add(new Vector3Int(position.X + chunkSize, position.Y - chunkSize, position.Z)); // DownRight
            }
        }
        if (downChunk)
        {
            chunksToUpdate.Add(new Vector3Int(position.X, position.Y - chunkSize, position.Z)); // Down
        }
        else if (upChunk)
        {
            chunksToUpdate.Add(new Vector3Int(position.X, position.Y + chunkSize, position.Z)); // Up
        }


It makes code a little bit more readable by using bool named variables and also has less code lines and if else branching.

Moreover, it is often (almost every time) better to have less nesting via inverting if statement like I did. So basically I quit if it is not an edge tile.