Preheat the oven to 375°F/190°C with a rack in the top third of the oven. Generously butter the inside of an 8-inch/20cm square baking dish.
In a bowl, mix together the oats, half the walnuts, the sugar, if using, the baking powder, cinnamon, and salt.
In another bowl, whisk together the maple syrup, if using, the milk, egg, half of the butter, and the vanilla.
Arrange the bananas in a single layer in the bottom of the prepared baking dish. Sprinkle two-thirds of the berries over the top. Cover the fruit with the oat mixture. Slowly drizzle the milk mixture over the oats. Gently give the baking dish a couple thwacks on the countertop to make sure the milk moves through the oats. Scatter the remaining berries and remaining walnuts across the top.
Bake for 35 to 45 minutes, until the top is nicely golden and the oat mixture has set. Remove from the oven and let cool for a few minutes. Drizzle the remaining melted butter on the top and serve. Sprinkle with a bit more sugar or drizzle with maple syrup if you want it a bit sweeter.