Preheat the oven to 375 degrees F (190 degrees C). Spray cups of two 12-cup mini muffin pans with nonstick cooking spray.
Heat olive oil in a skillet over medium heat. Add onion and cook until the edges of the onion begin to brown and caramelize, about 3 minutes. Add mushrooms and garlic, and cook until mushrooms are soft, 3 to 4 minutes. Season with salt and pepper. Transfer vegetables to a paper towel-lined plate with a slotted spoon.
Roll out puff pastry sheet into a horizontal rectangle on a large, lightly floured cutting board. Use a pizza slicer to cut pastry into 4 rows horizontally and 6 rows vertically so that you have 24 (2 1/2-inch) squares. Press each dough square into each mini muffin cup and prick with the tines of a fork.
Divide mushroom mixture amongst pastry cups. Top with shredded Gruyere and Parmesan cheeses. Sprinkle with thyme.
Bake in the preheated oven until the pastry is puffed up and the corners are golden brown, 14 to 16 minutes. Cool in the pans on a wire rack for 3 minutes before transferring the bites to a serving dish.