Peel onions and garlic. Wash and seed the chilli. Dice everything finely. Fry the minced meat in 1 tbsp. hot oil until crumbly. Fry with onions and garlic for another 5 minutes. Season with salt. Stir in tomato paste. Dust with flour and sauté briefly. Deglaze with tomatoes and approx. 1⁄8 l water, chop the tomatoes a little bit with a spatula. Add chili and bay leaf. Bring everything to the boil, cover and stew for about 20 minutes.
Rinse and drain the beans. Peel, wash and cut the potatoes into thick slices. Grate cheese roughly. Add the beans to the mince about 5 minutes before the end of cooking time. Season to taste.
Grease the casserole dish (approx. 2 l capacity) with 1 tablespoon of oil. Line the bottom with 1⁄3 potato slices. Spread half of the chili on top and sprinkle half of the cheese on top. 1⁄3 Layer potatoes on top and spread the rest of the minced meat on top. Finish with remaining potatoes and sprinkle with the rest of the cheese. Bake in a preheated oven (electric cooker: 175 °C/circulating air: 150 °C/gas: see manufacturer) for about 1 hour.