### Godot version

v4.0.beta16.mono.official [518b9e580]

### System information

Windows 10

### Issue description

Using Y-Sort in a TileMap does not behave as expected when using large tiles:

![image](https://user-images.githubusercontent.com/22286697/215344922-58bc1ff7-870d-4b5c-914b-02f6d94626f4.png)

The large trees should both obscure the small tree, but notice that that tree on the right is drawn behind the small tree. This is not apparent until the large tree is 2 or more tiles to the right of the small tree:

![image](https://user-images.githubusercontent.com/22286697/215344971-15275514-e63c-4c97-8c98-62fb748a3d12.png)
![image](https://user-images.githubusercontent.com/22286697/215344976-6715d876-76b2-4fd6-aa67-fd543c45f2f7.png)


### Steps to reproduce

1. Create a large tile that is more than 3 tiles wide
2. Place it 2 or more tiles to the right (and 1 tile or more below) a smaller tile (3x3 in my case for the small tree)
3. Observe the incorrect sorting
4. Repeat but place the larger tile anywhere left of 2 tiles to the right of the small tile
5. Observe the correct sorting

### Minimal reproduction project

[YSortIssueMRP.zip](https://github.com/godotengine/godot/files/10530763/YSortIssueMRP.zip)

TileSet::TileOffsetAxis offset_axis = ts->get_tile_offset_axis();
		if (offset_axis == TileSet::TILE_OFFSET_AXIS_HORIZONTAL) {
			switch (bit) {
				case 1:
					output[base_cell_coords] = TileSet::CELL_NEIGHBOR_RIGHT_SIDE;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_LEFT_SIDE;
					break;
				case 2:
					output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_CORNER;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_CORNER;
					break;
				case 3:
					output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_SIDE;
					break;
				case 4:
					output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_CORNER;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_LEFT_CORNER;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_CORNER;
					break;
				case 5:
					output[base_cell_coords] = TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE;
					output[tile_map->get_neighbor_cell(base_cell_coords, TileSet::CELL_NEIGHBOR_BOTTOM_LEFT_SIDE)] = TileSet::CELL_NEIGHBOR_TOP_RIGHT_SIDE;
					break;
				default:
					ERR_FAIL_V(output);
			}
		} else {
			switch (bit) {