Add the blueberries, sugar, lemon juice, and tied lemon thyme to a 2-quart saucepan over medium-high heat.
Bring the mixture to a boil, then reduce the heat to medium-low. Simmer for about 10 minutes.
Reduce the heat to low and continue simmering for another 10 minutes, stirring often, until the blueberry mixture thickens into a jam-like consistency. Remove the lemon thyme and let the jam cool for 10 minutes.
Lay 4 slices of sourdough on a clean work surface. Spread the blueberry jam evenly over the bread.
Divide the white cheddar and mozzarella between the slices, then top with the remaining bread to form sandwiches.
Heat a 12-inch cast-iron skillet over medium heat. Add 2 tablespoons of butter and let it melt.
Place two sandwiches in the skillet and cover with a lid. Cook for 2–3 minutes, or until the bread is golden brown.
Carefully flip the sandwiches and cook for another 2–3 minutes, until the second side is golden and the cheese is completely melted. Lower the heat if the bread is browning too quickly.
Transfer the sandwiches to a cutting board. Add the remaining butter to the skillet and repeat with the remaining sandwiches.
Cut the sandwiches in half. Finish with a pinch of flaky sea salt and a few fresh lemon thyme leaves. This blueberry white cheddar grilled cheese is best served warm while the cheese is still gooey.