Preheat the oven to 375°F (190°C).
In a pan, sauté onions and garlic in olive oil until softened. Add mushrooms and cook until they release moisture.
Sprinkle flour or cornstarch over the mushroom mixture, stir well, and cook for another 2 minutes.
Add vegetable broth, plant-based milk, thyme, rosemary, smoked paprika, salt, and pepper. Stir until the mixture thickens.
In a greased casserole dish, layer sliced potatoes and pour the mushroom mixture over them.
Optionally, sprinkle vegan cheese on top.
Cover with foil and bake for 45 minutes. Uncover and bake for an additional 15 minutes until the top is golden.