Preheat Oven & Prep Tomatoes: Preheat oven to 425°F. Halve large tomatoes and place cut side up on a baking sheet. Trim garlic head top to expose cloves.
Roast Tomatoes & Garlic: Drizzle tomatoes and garlic with olive oil, sprinkle with salt and pepper, tuck thyme sprigs around, and roast 35–40 minutes until edges caramelize.
Caramelize Onions: Melt butter in a large pot over medium heat. Add sliced onions and a pinch of salt. Cook 12–15 minutes until golden and soft.
Add Tomato Puree & Balsamic: Stir in tomato puree and cook 1–2 minutes. Add balsamic vinegar and mix well.
Add Roasted Tomatoes & Garlic: Remove thyme from roasted tomatoes, squeeze garlic cloves from skins, and add both to the pot.
Add Stock & Basil: Pour in stock, add torn basil, salt, pepper, and sugar if using. Stir and bring to a gentle simmer.
Simmer Soup: Let the soup simmer uncovered for 15–20 minutes so flavors blend and it thickens slightly.
Blend Until Smooth: Use an immersion blender or countertop blender to puree soup until smooth and creamy. Adjust seasoning as needed.
Assemble Inside-Out Grilled Cheese: Butter one side of each bread slice, place shredded cheddar on the unbuttered side, top with another slice, buttered side out.
Toast Sandwiches: Heat skillet over medium. Cook sandwiches 2–3 minutes per side until golden. Sprinkle extra shredded cheddar on outside for crispy crust.
Rewarm Soup & Serve: Gently reheat soup if needed. Ladle into bowls, top with basil if desired, and serve with grilled cheese for dipping.