Preheat the oven to 400°F.
In a skillet over medium heat, melt the butter and add the chopped onion. Sauté until the onions are soft and translucent, about 5-7 minutes.
Stir in the garlic powder, thyme, salt, and pepper. Cook for an additional 2 minutes, then remove from heat and let cool slightly.
In a large bowl, combine the ground sausage with the sautéed onion mixture. Mix until well combined.
On a lightly floured surface, roll out the puff pastry to smooth out any creases. Cut the pastry into rectangles, approximately 4 inches by 6 inches.
Place a generous tablespoon of the sausage mixture along one edge of each pastry rectangle. If using, sprinkle a little mozzarella cheese on top of the sausage mixture.
Roll the pastry over the filling to create a log shape, sealing the edges with a fork.
Place the rolls seam-side down on a baking sheet lined with parchment paper.
Brush the tops of the rolls with the beaten egg to give them a golden color while baking.
Bake in the preheated oven for 20-25 minutes, or until the pastry is puffed and golden brown.
Allow to cool for a few minutes before serving.