Prepare syrup: In a saucepan, combine sugar, water, and freshly squeezed lemon juice. Stir and bring to a boil over medium heat. Once boiling, reduce heat and simmer for 5 minutes. Turn off heat and set aside to cool.
Prepare cornflakes mixture: In a bowl, slightly break 6 cups of cornflakes by hand to soften them a bit. Melt 3 tablespoons of butter gently on low heat without burning. Pour melted butter over cornflakes and add 1/2 cup chopped pistachios if using. Mix well.
Layer cornflakes in tray: Place one-third of the cornflakes mixture evenly in the bottom of a Pyrex tray.
Prepare cream: In a saucepan, combine 3 cups whole milk, 1 tablespoon flour, 1 tablespoon cornstarch, and 1 box of cream. Whisk well before heating to avoid lumps. Place on medium heat and stir continuously until the mixture thickens and boils. Lower heat and add 1/2 teaspoon vanilla extract and 1 teaspoon butter (optional). Stir until butter melts and cream is smooth.
Assemble dessert: Pour the hot cream over the cornflakes layer in the tray. Optionally sprinkle some pistachios on top of the cream. Then spread the remaining two-thirds of the cornflakes mixture evenly over the cream layer.
Bake dessert: Preheat oven to 200°C (392°F) with heat from above and below. Place the tray in the middle of the oven and bake for about 20 minutes (a third of an hour) until the cornflakes are crunchy and the layers are set.
Add syrup and chill: Remove the dessert from the oven while hot. Pour the cooled lemon syrup evenly over the dessert. Let it cool to room temperature, then refrigerate for at least 2 hours to allow the dessert to set and flavors to meld.
Serve: Serve chilled or warm as preferred. The dessert will have a crunchy texture with creamy layers and a sweet, tangy syrup.