Pre-heat oven to 350F (180C). Lightly grease and flour a medium 8 ½ x 4½ inch (21 x 11 cm) baking dish.
In a small bowl mix together the parmesan cheese and bread crumbs. Set aside.
In a large bowl add the mashed potatoes, flour, parmesan cheese, salt, pepper and egg. Mix to combine.
Transfer ⅔ of the mixture to the prepared baking dish, and spread it evenly on the bottom and up half the sides of the pan.
Sprinkle the cubed ham or speck on top, top with the shredded cheese, top with small spoonfuls of the remaining mashed potato mixture on top. Sprinkle the bread crumb mixture on top and dot with butter. Bake in the pre-heated oven for 35-45 minutes or until browned on top. Let sit 5-10 minutes before serving. Enjoy!
If needed to brown the top, broil for 2-3 minutes.Leftovers should be stored covered or in an airtight container in the fridge. They will keep for up to 4 days in the fridge. Reheat covered in a low oven until heated through or in the microwave. The casserole can be frozen, be sure to cool it completely in the baking dish, then cover it with plastic wrap and again with foil. It will keep in the freezer for up to 1 month. Thaw overnight in the refrigerator. Bake in a low oven until warmed through.The casserole can be made ahead, be sure to cover the unbaked casserole and refrigerate, it will keep for up to 24 hours in the fridge.