Preheat the oven to 375°F (190°C).
Bring a large pot of salted water to a boil and cook the broken spaghetti according to package directions until al dente; drain and set aside.
Halve each garlic knot horizontally like a sandwich. Arrange the bottom halves in a single layer in a 9x13-inch casserole dish.
Spread about 1/3 cup basil pesto evenly over the bottom halves of the garlic knots.
Spread the cooked spaghetti evenly over the pesto layer.
Spoon the 24 oz jar of roasted garlic pasta sauce over the pasta in an even layer.
Sprinkle the shredded mozzarella and then the shredded parmesan evenly over the sauce.
Place the top halves of the garlic knots over the cheese in an even layer.
Bake in the preheated oven for 12–15 minutes, or until the garlic knots are lightly browned and the cheese is melted.
While baking, whisk the melted butter with the garlic powder and chopped parsley in a small bowl.
Remove the casserole from the oven and brush the butter mixture over the tops of the garlic knots. Serve hot.