Preheat oven to 400°F.
Begin by combining the sliced potatoes and red onion with olive oil, salt, pepper, thyme, and oregano in a medium-sized bowl.
Spread them in a single layer on the bottom of a 9x13 inch baking pan. Bake for 20 minutes until they begin to soften and turn golden.
As the potatoes bake, prepare the eggplant slices by setting them on paper towels and sprinkling salt on each slice. Allow them to rest for approximately 10 minutes, then turn them over and add more salt. After another 10 minutes, use paper towels to absorb any excess moisture on the eggplant.
Arrange the eggplant slices in a single layer on top of the potatoes. Drizzle olive oil over the slices, and season with salt and pepper. Next, sprinkle thyme and oregano on top. Return the pan to the oven and continue baking for an additional 20 minutes.
Layer the zucchini slices evenly over the eggplant, forming a single layer. Drizzle with olive oil, season with salt and pepper, and then sprinkle thyme and oregano on top. Bake for an additional 20 minutes.
While waiting, begin preparing the meat. In a large skillet, warm the olive oil over medium-high heat. Sauté the onion until it becomes soft, which should take around 3 minutes. Then, add the garlic and cook for approximately 30 seconds, or until you can smell its aroma.
Incorporate the ground meat into the skillet, using a wooden spoon to break it into small pieces. Cook until it loses its pink color, which should take around 5 minutes. Season the meat with salt and pepper. Mix in the allspice, Italian seasoning, and tomato paste thoroughly. Add the chopped tomatoes and cook for another 5 minutes, stirring now and then, until most of the liquid has evaporated. Set the mixture aside.
To prepare the bechamel sauce, melt the butter in a saucepan over medium heat. Once the butter has melted, whisk in the flour until it is completely combined with the butter. Gradually add the milk in four portions, whisking continuously. After each portion, ensure the liquid is fully absorbed by the flour mixture before adding the next.
As the sauce begins to bubble, it is ready for the addition of pepper and nutmeg. Whisk in the egg yolks thoroughly, then stir in the Parmesan cheese. Allow the sauce to reach a boil once more before removing it from the heat.
Add about ¼ of this sauce to the meat mixture and stir.
Spread the meat filling over the vegetable layers, then pour the bechamel sauce over the meat and smooth it out with a spatula or spoon.
Bake for another 30 minutes or until the top is golden brown.
Remove from the oven and allow it to cool at least 1 hour before cutting it into pieces.
Garnish with parsley if preferred before serving.