Preheat your oven to 350°F / 175°C.
Cook the pasta according to package directions until al dente.
Drain well and return it to the warm pot.
While the pasta cooks, create the sauce.
In a food processor, blend the ricotta cheese until completely smooth.
Add the egg, half-and-half, sugar, salt, pepper, and nutmeg. Process again until just combined.
Stir in the fresh herbs by hand.
Pour the creamy ricotta mixture over the cooked pasta in the pot, stirring gently to coat every piece.
In a large skillet, heat 3 tablespoons / 45ml (1.5 fl oz) of the oil over medium-high heat.
Add the sliced mushrooms and cook, stirring occasionally, until they are tender and all their liquid has evaporated.
Remove the mushrooms from the skillet and set aside.
Add the remaining 1 tablespoon / 15ml (0.5 fl oz) of oil to the same skillet.
Add the chopped onion and minced garlic, cooking until the onion is soft and fragrant. Return the cooked mushrooms to the skillet, add the fresh spinach, and stir for 2-3 minutes until the spinach is just wilted.
Drain any excess liquid from the vegetable mixture using a colander.
Add the drained vegetables to the pasta and sauce mixture.
Stir in 1 cup / 115g (4.1 oz) of the shredded Swiss cheese.
Transfer the entire mixture to an ungreased 3-quart / 2. 8-liter rectangular baking dish.
Cover with foil and bake for 20 minutes.
Remove the foil, sprinkle the top evenly with the remaining 1 cup / 115g (4.1 oz) Swiss cheese and the Parmesan cheese.
Bake uncovered for another 10 to 15 minutes, or until the casserole is bubbly and the top is golden brown.
Let it rest for a few minutes before serving.
Don't overcrowd the pan when cooking the mushrooms.
Sauté them in batches if necessary to ensure they brown properly rather than steam. This develops a much deeper, earthier flavor.