Line the bottom and sides of a 9-inch-square baking dish with the vanilla wafers. Set aside.
In a medium saucepan, combine the sugar and flour. Add the milk, whisk, and bring to a boil over medium-high heat. Lower the heat to medium-low and simmer, whisking constantly, until thick, about 3 to 4 minutes. Remove from the heat.
In a medium bowl, whisk the eggs. Gradually whisk about 3/4 cup of the hot milk into the egg. Return the egg mixture to the saucepan with the hot milk and bring to a boil. Lower the heat and simmer, whisking constantly, until smooth and thick, about 2 minutes. Remove from the heat and add the butter, vanilla extract and banana extract. Whisk until the butter is melted and the mixture is smooth. Transfer to a clean bowl and cool to room temperature.
In a bowl, whip the cream until soft peaks begin to form. Add the sugar and whip until stiff peaks start to form. Add the rum and whip to incorporate. Set aside.
Pour half of the pudding over the vanilla wafers, top with the bananas. Add the remaining pudding, smoothing it over the sliced bananas. Top with the whipped cream, and smooth with the back of a spoon. Drizzle chocolate sauce over the cream and top with walnuts.
Cover tightly and chill at least 2 hours before serving