Yes, this is exactly what I'm doing. My problem is, that the TileSet ID used to identify the TileType is generated dynamically and differs for every level. I'm using the YATI tiled importer. The ID is generated while importing the tile map. Not every level has the same number of TileSets.
I need a way to Identify the TileSets from its name, image name, or something else that stays the same.
Here is my c# code for replacing tiles with scene sprites with the ID just for completeness:
private static void ReplaceTile(PackedScene scene, int layer, TileMap tileMap, TileId id)
{
var cellsWithId = tileMap.GetUsedCellsById(layer, (int)id);
foreach (var cell in cellsWithId)
{
Node2D coinScene = scene.Instantiate<Node2D>();
coinScene.Position = tileMap.MapToLocal(cell);
tileMap.EraseCell(layer, cell);
tileMap.AddChild(coinScene);
GD.Print($"Scene added: { scene } { coinScene.Position}");
}
}