Preheat oven (E:cooker 230°C/circulating air:210°C). Peel onions and garlic, dice finely. Heat oil in a pot, fry onions and garlic until transparent. Add tomatoes and juice. Mash tomatoes with a spatula. Bring to the boil and stir in the stock. Season with vinegar, salt and pepper, simmer for about 5 minutes.
In the meantime cut the mozzarella into thin slices. Grease an oven dish (approx. 18x25 cm). Layer sauce, ravioli and 2/3 grated cheese alternately in the dish and finish with sauce. Spread mozzarella and the rest of the cheese cubes on top. Bake in a hot oven for 15-20 minutes until golden brown.