### Godot version

4.2.dev3.official[013e8e3af]

### System information

Godot v4.2.dev3 - Arch Linux #1 SMP PREEMPT_DYNAMIC Fri, 11 Aug 2023 11:03:36 +0000 - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 2060 (nvidia; 535.98) - Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 Threads)

### Issue description

`TileMap.get_used_cells_by_id()` seems not work as expected.
It seems that this method will return the same result as "TileMap.get_used_cells()" since Godot 4.2dev2.
The arguments  (`source_id: int`, `atlas_coords: Vector2i`, `alternative_tile: int`) of `get_used_cells_by_id()` seems not make the filter working as expected.  It would only return the same result as `get_used_cells()`, contains all the tiles on the layer.

### Steps to reproduce

1. create a tilemap scene
2. attach a tileset, that contains  at least 2 tiles , paint some tiles.
3. calls Tilemap.get_used_cells_by_id(layer, source_id, atlas_coords,alternative_tile)
4. run it

### Minimal reproduction project

run tile_map.tscn by Godot4dev3 (or custom build)
[tilemap_debug.zip](https://github.com/godotengine/godot/files/12369631/tilemap_debug.zip)

}
		q_list_element = q_list_element->next();
	}
}
TileSet::TerrainsPattern TileMapLayer::_get_best_terrain_pattern_for_constraints(int p_terrain_set, const Vector2i &p_position, const RBSet<TerrainConstraint> &p_constraints, TileSet::TerrainsPattern p_current_pattern) {
	const Ref<TileSet> &tile_set = tile_map_node->get_tileset();
	if (!tile_set.is_valid()) {
		return TileSet::TerrainsPattern();
	}
	
	RBMap<TileSet::TerrainsPattern, int> terrain_pattern_score;
	RBSet<TileSet::TerrainsPattern> pattern_set = tile_set->get_terrains_pattern_set(p_terrain_set);
	ERR_FAIL_COND_V(pattern_set.is_empty(), TileSet::TerrainsPattern());
	for (TileSet::TerrainsPattern &terrain_pattern : pattern_set) {
		int score = 0;
		
		TerrainConstraint terrain_constraint = TerrainConstraint(tile_map_node, p_position, terrain_pattern.get_terrain());
		const RBSet<TerrainConstraint>::Element *in_set_constraint_element = p_constraints.find(terrain_constraint);
		if (in_set_constraint_element) {
			if (in_set_constraint_element->get().get_terrain() != terrain_constraint.get_terrain()) {
				score += in_set_constraint_element->get().get_priority();
			}
		} else if (p_current_pattern.get_terrain() != terrain_pattern.get_terrain()) {
			continue; 
		}
		
		bool invalid_pattern = false;
		for (int i = 0; i < TileSet::CELL_NEIGHBOR_MAX; i++) {
			TileSet::CellNeighbor bit = TileSet::CellNeighbor(i);
			if (tile_set->is_valid_terrain_peering_bit(p_terrain_set, bit)) {