Preheat your oven to 400°F. Toss the mushrooms and onion with olive oil on a baking sheet. Sprinkle with salt and pepper. Roast for about 18-20 minutes, or until they reach your desired level of caramelization.
While the veggies are roasting, melt butter in a pan over medium heat. Lay out the bread slices and add a layer of gouda, followed by the roasted mushrooms and onions, and top with another layer of cheese. Add salt and pepper as desired. Press the bread slices together gently.
In the melted butter, place the sandwich on the pan. Flip it quickly to coat both sides with butter. Grill for about 2 minutes on each side until golden and crispy, flipping once more if needed, until the cheese is fully melted.