Heat butter in a large skillet over medium-high heat. Pour the mushrooms into a preheated pan and fry, stirring occasionally, until golden brown, about 2-3 minutes. Add the garlic to the pan and cook for about 30 seconds. Add wine, cook for 2 minutes. Pour the parsley into the pan, put a sprig of thyme, and add 1/4 teaspoon of black pepper. Cover the pan with a lid, reduce heat and simmer for about 10 minutes. Then remove the lid and cook until the liquid evaporates, about 6 minutes. Remove the pan from the stove, remove the thyme sprig. Add the cream cheese to the pan, stir until the cheese is melted. Transfer the contents of the skillet to a bowl. Wipe the pan with a paper towel or wash.
Put a skillet over medium-high heat, drizzle lightly with vegetable oil, add onion, and cook, stirring occasionally, for about 5 minutes. Reduce heat to medium and cook onions, stirring occasionally, until golden brown, about 15 minutes. Remove the pan from the stove.
Sprinkle with vegetable oil on an ovenproof dish with a volume of about 1200 g. Put the potato slices in an oiled dish and top with the spinach leaves, sprinkle with 1/4 teaspoon of salt and pepper. Put the mushroom mixture on top and on it the turnip slices. Put the fried onion on the turnips, sprinkle with 1/4 teaspoon of salt, 1/4 teaspoon of black pepper, and tarragon. Pour the cream over the contents of the form and sprinkle with chopped cheese. Cover the dish with a lid and place it in a preheated oven. Cook potato casserole with mushrooms at 180 degrees for about 40 minutes. Then remove the lid and cook for about 20 minutes more, until the vegetables are soft and the cheese is golden brown.