Preheat the oven to 425°F.
Add the tomatoes, onion, and garlic to a large oven-safe pot or Dutch oven. Drizzle with olive oil and season with salt and pepper.
Roast for 25–30 minutes, until the tomatoes are soft, juicy, and beginning to caramelize around the edges.
Remove the pot from the oven and allow it to cool slightly.
Add the coconut milk or whole milk. Use an immersion blender to blend everything directly in the pot until smooth and creamy.
Place the pot over medium-low heat and stir in the basil pesto. Heat for 3–5 minutes.
If the soup is too thick, add additional milk a little at a time until it reaches your preferred consistency. Taste and adjust the seasoning as needed.
Reduce the oven temperature to 400°F.
Ladle the warm soup into oven-safe mini crocks, leaving approximately ¾ inch of space at the top.
Cut the thawed puff pastry into circles approximately ½–1 inch larger than the openings of the crocks.
Whisk together the egg and water. Brush a small amount of egg wash around the outside rim of each crock.
Lay the puff pastry over each crock and gently press it around the rim to adhere.
Brush the tops with the remaining egg wash and sprinkle with freshly grated Parmesan, if desired.
Place the crocks on a sheet pan and bake at 400°F for 15–20 minutes, until the puff pastry is puffed and golden brown.
Let cool for a few minutes before cracking through the puff pastry and serving.