Sort the spinach, wash well and drain. Peel and finely chop the onions. Heat the oil in a large pot. Fry half of the onions in it. Add the spinach and let it collapse briefly.
Pour into a sieve and drain well, squeeze a little if necessary. Season with salt, pepper and nutmeg.
Peel, wash, halve and thinly slice the kohlrabi. Blanch in boiling salted water for 2-3 minutes, also drain.
For the béchamel sauce, peel and finely chop the garlic. Heat 3 tablespoons of butter in a saucepan. Sauté the garlic and the rest of the onion. Dust with flour and sauté lightly while stirring. Stir in milk and 1⁄4 l water, bring to the boil.
Stir in the stock and simmer for about 5 minutes. Season to taste with salt and nutmeg.
Preheat oven (electric cooker: 175 °C/circulating air: 150 °C/gas: see manufacturer). Wash and slice the tomatoes. Cut spinach into smaller pieces. Grease an oven dish (approx. 20 x 30 cm) and line with approx. 1⁄3 of the kohlrabi slices.
Alternately layer spinach, slices of ham, tomatoes, béchamel sauce and the remaining kohlrabi slices, finishing with béchamel sauce. Grate the cheese directly on top. Sprinkle with sunflower seeds. Bake in a hot oven for about 40 minutes.