Spread the cubed bread out on a baking sheet, in a single layer, and put it in a low oven (300°F / 150°C) for 20 minutes, tossing the bread halfway through so it is dried out on all sides. Then remove from oven and set aside. *The bread should be dried out, but not browned.
Spray a 2.5qt / 2.5L casserole dish with non stick cooking spray, or butter the pan. Place the dried bread in the bottom of the dish.
Whisk the ingredients for the custard together (or use an immersion blender) and pour half of the mixture over the bread.
Lightly press down to make sure the bread is covered with egg mixture. Place in refrigerator while you cook the vegetables.
In a large skillet over medium heat, brown the ground pork. Add diced onion, garlic, sage, thyme, brown sugar and red pepper flakes. Cook until pork is browned and cooked through. Transfer pork to a bowl to cool. Do not rinse the pan.
In the same pan, cook mushrooms over medium heat for about 10 minutes, then remove from pan and set aside to cool.
Next, add spinach to the pan and cook over low heat until spinach is wilted (about 4-5 minutes). Set aside.
Start assembling: Remove the casserole dish from the refrigerator. Shingle a layer of potatoes on top of soaked bread. Then spread sausage over the potato layer.
Place cooked mushrooms and spinach on top of sausage.
Shingle another layer of potatoes on top of mushrooms and spinach.
Finish by pouring the remaining egg mixture over the top and lightly pressing down to make sure the egg custard coats all of the layers and fills in the gaps. (This will help to hold everything together.)
Cover with foil and bake at 350°F / 180°C for 50 – 60 minutes, or until a knife easily pierces the potatoes.
Uncover, top with cheese and return to the oven for 6 - 8 minutes until cheese is melted and bubbling. Top with fresh herbs (ex: chives, thyme, parsley) while warm, if desired.