Preheat the oven to 180ºC.
Prepare the squash and vegetables: Place the butternut squash cubes, sliced onion, and peeled garlic on a baking tray. Sprinkle with rosemary and drizzle with olive oil.
Roast the vegetables: Bake in the preheated oven for about 30 minutes, or until the onions and garlic are tender and golden, and the squash is soft and cooked through.
Make the purée: Transfer the roasted vegetables to a food processor or blender and blend until smooth, adding a little water if needed to achieve a thick, smooth purée.
Cook the pancetta or prosciutto: In a medium frying pan with high sides, heat 5 ml (1 teaspoon) of olive oil over medium heat. Once hot, fry the pancetta or prosciutto until crispy. Transfer the crispy pieces and fat to a small bowl.
Prepare the gnocchi: Spoon the butternut squash purée into the frying pan, add 75 ml of water and the milk, and stir in the gnocchi. Gently simmer uncovered for 8-10 minutes until the gnocchi is tender.
Finish the sauce: Stir in the parmesan and lemon juice, adjusting seasoning to taste. Add half of the pancetta or prosciutto along with some of the reserved fat.
Melt the mozzarella: Place the torn mozzarella pieces on top of the gnocchi. Place the pan under the grill (broiler) for about 5 minutes, or until the cheese is melted.
Garnish and serve: Top with the remaining pancetta or prosciutto, cracked black pepper, walnuts, and fresh parsley.