Wash the pumpkin and scrape out the seeds and fibres with a spoon. Cut the pumpkin with skin into slices and dice roughly. Peel and wash the potatoes and dice them coarsely. Cover and cook in salted water for about 25 minutes.
Peel, wash and finely dice the carrots. Peel and finely chop onion and garlic. Heat oil in a pan. Fry the minced meat in it until crumbly. Fry carrots, onion and garlic for 2-3 minutes. Sweat tomato paste briefly and add strained tomatoes.
Season with salt, pepper, 1 pinch of sugar and paprika. Bring to the boil and simmer at low heat for about 5 minutes. Season to taste and fill into an ovenproof dish.
Drain the pumpkin mixture. Add 150 ml milk and 50 g butter and mash everything with a potato masher. Season to taste with salt and nutmeg, spread loosely on the mince.
Preheat oven (electric cooker: 200 °C/circulating air: 175 °C/gas: see manufacturer). Grate cheese finely. Briefly sauté flour in 1 tbsp. hot butter. Deglaze with 150 ml milk and 100 ml water. Bring to the boil and simmer for about 5 minutes.
Melt half the cheese in it, season with salt and nutmeg. Pour over the casserole and sprinkle with the rest of the cheese. Bake in a hot oven for 18-20 minutes.