Place the tomato slices on a rimmed baking sheet, drizzle with olive oil, and season with salt and pepper. Roast for 15 to 20 minutes.
If you are using a single loaf of bread, slice it in half vertically to create 2 sandwich buns about 6 to 8 inches long. Then slice each bun in half horizontally.
Spread pesto on the bottom bun of each sandwich. Add enough baby spinach leaves to cover the bread in a single layer. Arrange 4 or 5 tomato slices over the spinach, followed by 3 slices of fresh mozzarella. Cover the sandwiches with the top buns.
Place the sandwiches in the oven until heated through, about 5 to 7 minutes. Make sure the sandwiches aren’t too close to the heating element, and watch closely to make sure the bread does not burn.