Heat the peanut oil in a large skillet over medium heat until it moves easily across the pan. Add the onion, carrot, celery, salt, and pepper and cook, stirring occasionally, until the vegetables begin to soften, about 5 minutes. Add the garlic, cook for 1 minute, then add the mushrooms and thyme leaves. Cook, stirring frequently, until the mushrooms are almost tender, about 3 minutes. Add the tomato, cook for about 2 minutes more, then add the stock 2 tablespoons at a time, bringing to a simmer before each addition. Simmer the bolognese until it is concentrated but not yet dry, about 30 minutes. Set aside to cool.
Moisten the polenta with 2 tablespoons of water, mixing well with your hands. Bring 4 cups of water to a boil in a saucepan over high heat. Add a pinch of salt and gradually stir in the polenta. Stirring constantly, bring the polenta to a boil, then reduce the heat to low. Cook the polenta, stirring occasionally, until it is no longer grainy, about 30 minutes. Stir the olive oil into the polenta, season with salt, and remove it from the heat.
TO ASSEMBLE: Heat the oven to 350 degrees. Spoon 1/2 the polenta into a medium baking dish and cover with 1/2 of the sauce. Spoon in the remaining polenta, spread it evenly, then sprinkle with the Parmigiano-Reggiano cheese. Transfer the remaining sauce to a small saucepan and reserve.
Bake the gratin until the top is golden, about 40 minutes. Just before serving, warm the reserved sauce over low heat. Divide the gratin and sauce among 4 plates and serve.