Preheat your oven to 400°F (200°C). Spread the cubed squash and sliced carrots on a baking sheet, then drizzle with olive oil and toss to coat evenly. Roast for about 25-30 minutes, until tender and lightly caramelized.
Meanwhile, in a large pot, sauté the chopped onion over medium heat until it becomes translucent and fragrant, about 5 minutes. Add the minced garlic and cook for another minute until fragrant.
Add the roasted vegetables to the pot, pouring in the vegetable broth. Stir in the dried thyme, black pepper, and red pepper flakes if using. Bring to a gentle simmer and cook for about 10 minutes to allow flavors to meld.
Remove the pot from heat and add half of the chopped basil leaves. Use an immersion blender or transfer the mixture to a blender to puree until smooth and velvety. Return to the pot if needed and reheat gently.
Taste the soup and add salt as needed. Stir in the remaining basil leaves for a fresh burst of flavor. The soup should be warm, smooth, and fragrant with herbal notes.
Serve the soup hot, optionally garnished with extra basil leaves or a drizzle of olive oil for presentation. Enjoy the comforting, herbaceous flavor in every spoonful.