Mix red bell pepper, onion, and garlic in a large mixing bowl; season with basil, rosemary, salt, and pepper. Drizzle olive oil and balsamic vinegar over the pepper mixture; toss to coat the vegetables evenly.
Brush eggplant slices with olive oil to coat thinly.
Spread about 1/3 of the pepper mixture into the bottom of a square glass baking dish; top with a layer of about 1/3 of the eggplant. Repeat layering twice more. Top final layer with mozzarella cheese.
Bake in preheated oven until the cheese is browned and the vegetables are bubbling, 35 to 40 minutes.