Peel and finely dice the onions and garlic. Heat 3 tablespoons of oil. Sauté onion and garlic in it. Add tomato paste and herbs and sauté briefly. Deglaze with tomatoes and stock. Season with salt, pepper and sugar.
Simmer open for about 20 minutes.
Cook pasta in boiling salted water according to package instructions. Drain and allow to drain. Season sauce once more. Mix with the noodles and put into a greased casserole dish and spread.
Wash, clean and slice the tomatoes. Spread on the noodles. Drain mozzarella and grate coarsely. Sprinkle the casserole with it, sprinkle with 2 tablespoons of oil.
Bake in the preheated oven (electric cooker: 200 °C/ convection oven: 175 °C/ gas: see manufacturer) for approx. 30 minutes. Wash the basil, dab dry and remove the leaves. Remove the casserole from the oven, sprinkle with basil and possibly ground pepper.