Preheat and prep: Heat the oven to 375°F (190°C).
Lightly oil a 9x13-inch baking dish or a large oven-safe skillet.
Make a quick béchamel: In a medium saucepan, melt the butter over medium heat. Stir in the flour and cook, whisking, for 1–2 minutes until it smells toasty but not browned.
Whisk in milk: Slowly stream in the milk while whisking to avoid lumps. Add garlic, nutmeg, 1/2 teaspoon salt, and a few grinds of pepper.
Simmer, whisking often, until slightly thickened, 4–6 minutes.
Cheese it: Remove from heat and stir in the Parmesan until smooth. Taste and adjust seasoning. The sauce should be pourable and well-seasoned.
Season the marinara: In a bowl, stir the marinara with Italian seasoning and red pepper flakes.
Warm it slightly if it’s very thick.
Layer 1: Spread 1/2 cup marinara in the bottom of the dish. Scatter half the gnocchi in an even layer. Dollop half the ricotta over the gnocchi (if using).
Layer 2: Pour half the béchamel over the gnocchi.
Sprinkle with 1 cup mozzarella.
Layer 3: Spoon over 1 cup marinara. Add the remaining gnocchi and ricotta. Pour over the rest of the béchamel, then top with the remaining marinara.
Final cheese: Finish with the remaining 1 cup mozzarella and a light shower of Parmesan.
Bake: Cover loosely with foil (tent it so it doesn’t stick to the cheese) and bake for 20 minutes.
Uncover and bake another 10–15 minutes, until the top is bubbling and lightly browned.
Rest and garnish: Let it rest 10 minutes so it sets slightly. Top with chopped basil or parsley. Serve hot.