Preheat your oven to 425°F / 220°C.
Brush any dirt off the mushrooms and cut or pull them apart into large, bite-sized pieces.
Spread them in a single layer on a baking sheet.
Lightly coat the mushrooms with cooking spray or oil, then sprinkle with the chopped rosemary, salt, and pepper.
Toss to combine.
Roast in the preheated oven for 5 minutes.
Carefully remove the baking sheet from the oven.
Add the chopped shallots and garlic, stirring to combine with the mushrooms.
Return the baking sheet to the oven and continue to roast for another 5 to 10 minutes, until the mushrooms are browned at the edges and the shallots and garlic are soft and fragrant.
Check every few minutes during the final roasting time to ensure the garlic does not burn.
Serve immediately.
Don't crowd the pan!
Spread the mushrooms in a single, even layer on your baking sheet. This allows them to roast and get crispy, rather than steam.
Keep a close eye on the garlic in the last few minutes of cooking. It can go from perfectly fragrant to burnt and bitter very quickly.