Peel and finely chop the onion and garlic. Heat 1 tablespoon of oil in a saucepan, fry the onion and garlic in it, dust with sugar, caramelise and deglaze with vinegar and tomatoes. Season with salt and pepper and simmer for about 10 minutes.
Prepare Maultaschen in boiling salted water according to package instructions. Wash and clean the cabbage and cut 250 g into strips, use the remaining cabbage for other purposes. Heat 1 tablespoon of oil in a frying pan and sauté the cabbage for about 2 minutes.
Drain the Maultaschen, cut them in half horizontally. Layer half of Maultaschen in an ovenproof dish (18 x 24 cm). Cut boiled ham in half, spread half on top. Spread half the cabbage on top and repeat the process.
Pour sauce over the casserole. Grate and mix the cheese, sprinkle over the casserole and bake in the preheated oven (electric cooker: 175 °C/ convection oven: 150 °C/ gas: see manufacturer) for approx. 30 minutes. Wash the basil, shake dry and remove the leaves from the stalks, garnish the casserole.