Preheat oven to 425 degrees. Prepare a 9×13 baking dish with cooking spray.
Place cubed squash on a sheet pan. Drizzle with olive oil, salt and pepper (to taste). Place in oven to roast for 20 minutes or until pieces are fork tender. Using the back of a wooden spoon, mash half of the pieces roughly. Leave on tray and set aside.
In a large, deep skillet, cook bacon until crisp. Remove bacon and place on a towel-lined plate. Drain all but 2 tablespoons of the bacon grease from the skillet.
Reduce heat to medium then add diced shallots. Cook until softened, about 3-5 minutes.
Add 4 tablespoons of butter to the shallots. Once melted, whisk in flour. Cook for about 1 minute or until the flour starts to brown. Whisk in milk with a slow, steady stream then bring to a boil, stirring constantly.
Once the sauce thickens, add 1 ½ cups of gruyere and 1 ½ cups of cheddar. Add 1 teaspoon of salt and about ½ teaspoon of pepper. Stir until cheese is melted then remove from heat.
Add rosemary, bacon, butternut squash and cooked pasta to the cheese sauce. Stir to combine. Pour mixture into the prepared baking dish.
Melt remaining 4 tablespoons of butter in a bowl. Add panko and parmesan then stir to combine.
Add remaining shredded cheese to top of pasta then sprinkle the panko mixture on.
Bake for 15 minutes or until topping starts to brown. Serve immediately.