Preheat the oven to 400°F (200°C). Spray a 9x9-inch baking dish with nonstick cooking spray.
To the baking dish, add the sliced onions, sun-dried tomatoes, paprika, salt, and pepper. Toss to combine. Set aside.
Peel away the loose, papery outer layers of the garlic, leaving the bulb intact. Cut about ½ inch off the tops of each bulb to expose the garlic cloves inside.
Nestle the garlic bulbs, cut side up, in the center of the onion mixture. Drizzle the entire dish with olive oil. Cover the dish tightly with aluminum foil. Roast in the oven for 60-70 minutes, or until the onions are golden and caramelized and the garlic is soft.
In the final 10 minutes of roasting, cook pasta al dente according to the package directions. Before draining the pasta, reserve 1 cup of pasta water and set aside.
Once the vegetables have finished roasting, carefully remove the garlic bulbs from the dish to cool. When the garlic is cool enough to handle, squeeze the roasted garlic cloves into the dish and discard the skins.
To the dish, add heavy cream, parsley, basil, and lemon juice.
Stir in the cooked pasta, adding a little reserved pasta water (if needed) to achieve a creamy consistency. Mix everything until well combined.
Serve warm, garnished with fresh parsley.