Cook the spaetzle al dente, then drain and set aside.
Wash and slice the mushrooms. Dice the onion. Sauté both in fat on medium-high heat for 5 minutes until soft.
Cut the ham into cubes and stir into the mushroom mixture. Set aside.
Slice the pork loin into roughly 1-2 cm thick pieces. Season with salt and pepper. Fry in fat on medium-high heat for 3-4 minutes per side until golden and cooked through (internal temperature should reach 63°C / 145°F).
Grease the baking dish with fat. Arrange the fried pork loin slices on the bottom.
Mix the cooked spaetzle with the mushroom and ham mixture, then spread over the pork.
In a saucepan, bring the meat stock to a boil. Dissolve the gravy cube in it. Remove from heat and stir in the cream, sauce powder, and BBQ sauce. Season with salt, pepper, paprika, and curry powder.
Pour the sauce over the assembled dish. Cover and refrigerate overnight.
The next day, preheat oven to 180°C (356°F). Cover the baking dish with foil and bake for 45 minutes.
Remove foil, sprinkle grated cheese evenly over the top, and bake uncovered for 10 more minutes until the cheese melts.