Preheat the oven to 190°C and lightly grease a 23 x 33 centimeter baking dish.
Bring a large pot of salted water to a boil. Cook the gluten-free elbow macaroni until just al dente according to the package directions, then drain well and set aside.
In a medium saucepan over medium heat, melt 30 grams unsalted butter. Whisk in the gluten-free all-purpose flour and cook for about 1 minute, stirring constantly, until smooth and lightly bubbling.
Gradually pour in the whole milk while whisking to keep the sauce smooth. Cook for 4 to 6 minutes, stirring often, until the mixture thickens enough to coat the back of a spoon.
Whisk in the garlic powder, onion powder, salt, and black pepper. Reduce the heat to low, then add the shredded cheddar and mozzarella a handful at a time, stirring until fully melted and smooth.
Add the drained macaroni to the cheese sauce and stir until the pasta is evenly coated. Transfer the mixture to the prepared baking dish and spread it into an even layer.
In a small bowl, combine the melted butter, crushed gluten-free cornflakes, and grated Parmesan cheese. Mix until the flakes are evenly coated.
Sprinkle the cornflake mixture evenly over the macaroni and cheese.
Bake for 25 minutes, until the sauce is bubbling around the edges and the topping is golden brown.
Let the dish rest for 5 minutes before serving so the sauce can settle slightly and the portions hold together better.