In a large pot, heat a couple of tablespoons of vegetable oil over medium-high heat. Add onions and whole spices and sauté until the onions are translucent. Add lamb cubes and fry until browned—season with ground spices. Pour in 6 to 8 cups of water, bring the liquid to a boil, and reduce the heat to medium. Cover the pot and simmer for about 45 to 60minutes. Strain the broth and set aside the lamb pieces and onions.
Wash and rinse the rice with cold water until the water runs clear. Soak in cold water for 30 minutes, then drain and set aside.
Heat vegetable oil in a shallow pot over medium-high heat. Fry eggplant slices in batches until golden brown. Transfer to a paper towel-lined plate and repeat the steps with the cauliflower and potatoes.
To assemble the maqluba, start by scattering a sparse layer of rice at the bottom of a large non-stick pot. Add a layer of sliced tomatoes, half of the fried eggplants, cauliflowers, and half of the cooked lamb. Repeat the layers with half the rice, followed by the rest of the vegetables and lamb. Finally, top it with the remaining drained rice on top. Pour the reserved lamb broth over all the layers, ensuring it covers the rice by approximately 2 centimetres (add more water if necessary). Add four teaspoons of salt, then bring it to a boil. Once boiling, cover the pot and let it simmer on low heat for about 45 minutes until the rice is cooked.
Allow the pot to cool for 5 minutes, then place a plate more significant than the pot's base on the mouth of your pan and carefully flip it upside down. Let the ingredients settle for a few minutes, then slowly remove the pot. Garnish the maqluba with toasted almonds and fresh parsley.