Toss tomatoes with olive oil to coat; season with salt and pepper. Spread tomatoes into a small baking dish.
Bake in the preheated oven until tender, about 25 minutes.
Top 2 pieces of bread with Gouda cheese slices; top remaining 2 bread slices with mozzarella. Spread roasted tomatoes over cheese. Sprinkle mozarella cheese over the tomatoes. Finish sandwiches with remaining mozzarella-topped bread slices.
Spread mayo onto both sides of of each sandwich.
Heat a cast-iron pan over medium-high heat. Cook sandwiches in hot pan until cheese is melted, 1 to 2 minutes per side. Cut each sandwich in half. You can also cook these in an air fryer for 3 minutes on each side. OR cook in your already hot oven for 4 minutes and then flipping.