In a large frying pan add the butter and chopped shallots. Soften the shallots for 10 minutes over a medium heat, stirring intermittently. Add the garlic and courgettes to the shallots and stir. Cook for 5 minutes then spoon the courgette mixture into a large bowl. Add the drained rice, eggs, grated Pecorino, mozzarella, dried marjoram, roughly torn basil and chopped celery leaves to the courgette bowl and stir well to combine. Stir and season with salt, pepper, and the chilli flakes. Pour the mixture into the prepared cake tin, cover with foil and bake for 20 minutes at 190C (fan-assisted oven). Remove the foil and finish baking for a further 5 minutes or until lightly golden.