Heat the oven to 350°F. Lightly butter an 8x8-inch baking dish. Rub the top of each slice of bread with the garlic clove. Lay the slices in the dish in one layer, cutting them into pieces where necessary. Season with salt and pepper.
Measure the milk in a 1-qt. measure, preferably one with a spout. (Or measure it and transfer it to a bowl.) Add the eggs, half of the cheese, the red pepper flakes, and a generous amount of salt and pepper. Whisk vigorously to beat the eggs and to combine. Add the basil and stir gently. Set aside.
In a large sauté pan, heat the oil over medium high. Add the onion; cook, stirring occasionally, until it softens and colors lightly, about 5 minutes. Meanwhile, trim the squash, cut them lengthwise into quarters and, holding the quarters together, slice them into pieces about 1/3 inch thick. Stir the squash into the onion, spread in a single layer, and let sit undisturbed for 1 to 2 minutes to encourage browning; check before you turn them.
Meanwhile, halve and seed the tomatoes and chop the flesh coarsely. When the squash is lightly browned on both sides and crisp-tender, add the tomatoes, stir to toss, and take the vegetables off the heat.
With a slotted spoon, transfer the vegetables to the dish, spreading them evenly over the bread. Give the milk and egg mixture a stir and gently pour it all into the dish. Top with the remaining cheese. Bake until the milk and egg mixture sets, 40 to 45 minutes. Let cool at least 5 minutes, slice into squares with the edge of a spatula, and use the spatula to lift out the pieces.