Preheat the oven to 350°. Place all the chopped vegetables in a bowl and drizzle with half the oil and season with salt and pepper.
Toss to coat all the vegetables in the oil. Scatter the vegetables in a single layer on a sheet pan and roast until the vegetables are softened, about 15 minutes.This may need to be done in two batches.
Cut the top off the bread to create a lid.
Hollow out the loaf by scooping out the soft bread (keeping it in large chunks) and leaving an edge of around 1¼ inches, so that the shell isn’t too thin.
Place half of the removed bread in a food processor and pulse to make breadcrumbs.
Mix the remaining oil with the vinegar, breadcrumbs and garlic, then mix with any juices from the roasting pan. Divide the mixture between the vegetables, season with salt and pepper and toss together. Leave to stand for an hour so that the vegetables and breadcrumbs soak up the juices.
Slice the mozzarella and pat dry with a napkin.
Take the hollowed out loaf and spread the pesto over the base. Begin layering the vegetables starting with the red pepper, then the eggplant, mozzarella, yellow pepper and finally the squash, adding a little torn basil between the layers. Repeat the layers until the loaf is full. Put the lid on, wrap tightly with plastic wrap and place in the fridge overnight.
Slice the loaf and serve.