Fill empty isometric Tilemap from script

Fill an empty isometric Tilemap from script:
This doesn’t work: ([u]Unity 2019.4.5f1 personal)[/u]

map.size.Set(10, 10, 1);
map.BoxFill(new Vector3Int(0, 0, 0), tile, -5, -5, 4, 4);
Debug.Log("bounds: " + map.cellBounds);

The size of an empty tilemap cannot be changed by map.size.Set(…)
Therefore BoxFill will do nothing, see the API docs:
If the limits are larger than the tilemap bounds, the limits will be capped to the tilemap bounds.

Here’s a workaround:
Put a tile at the min and max position of your desired area and then use BoxFill:

/* it won't work when calling BoxFill before setting the min and max tile: */
//map.BoxFill(new Vector3Int(0, 0, 0), tiles[0], -5, -5, 4, 4);
Vector3Int minPos = new Vector3Int(-5, -5, 0);
Vector3Int maxPos = new Vector3Int(4, 4, 0);
map.SetTile(minPos, tile);
map.SetTile(maxPos, tile);
map.BoxFill(new Vector3Int(0, 0, 0), tile, -5, -5, 4, 4);
Debug.Log("bounds: " + map.cellBounds);

WARNING:
When you call BoxFill before setting the min and the max tile, the map gets somehow corrupted and subsequent calls of BoxFill after setting the tiles don’t do anything.

This isn’t working for me, using

tilemap.SetTile(minPos, tile);
tilemap.SetTile(maxPos, tile);
tilemap.BoxFill(new Vector3Int(0, 0, 0), tile, minPos.x, minPos.y, maxPos.x, maxPos.y);

The only tiles which get written are the bottom left and the top right of the box, as though box fill isn’t doing anything at all

tilemap.SetTiles and tilemap.SetTilesBlock are more versatile and easy to understand. Use those.

BoxFill was spawned in the deepest depths of hell.