Preheat oven to 425, line 2 large sheets with parchment/foil.
Slice the eggplants and line them up on the sheet trays. Coat them evenly with nonstick spray, then season with thyme, 1/4 teaspoon salt, and ground pepper, and press the seasonings in. Flip the eggplant slices over, and repeat on other side.
Roast until golden brown and tender, about 20-25 minutes. Turn the eggplants and rotate the pans halfway through.
While eggplants are roasting, heat oil in a large skillet over medium. Add shallots, garlic, and red pepper flakes, cook until softened, about 4 minutes.
Add tomatoes and 1/4 tsp of salt. Bring to a boil over high heat, while breaking up the tomatoes with a spoon. Reduce heat to medium, and cook uncovered until thickened. About 20 minutes.
In a bowl, stir together the ricotta, 4 tablespoons of parmesan, basil, and 1/4 tsp salt.
In ANOTHER bowl, stir together the panko and remaining 2 tablespoons of parmesan.
Coat a 10 inch square baking dish with nonstick spray. For the first layer: Spread 1/2 cup sauce in bottom of dish, and top with a single layer of eggplant. Dot eggplant with 1/2 cup of the ricotta mixture, then and top evenly with 1/4 cup of mozzarella. For the second layer: A single layer of eggplant, 1 cup of sauce, and remaining 1/2 cup ricotta mixture. For the last layer: Layer remaining eggplant, 1/4 cup of mozzarella, and remaining sauce. Sprinkle top with the panko mixture.
Bake on the upper rack until top is golden and sauce is bubbly, about 15 minutes. Let stand 5 minutes before slicing.