Melt the ghee in a skillet over medium heat. Add the sliced onions and cook, stirring occasionally, for 20-25 minutes, until deep golden and jammy.
Stir in the maple syrup, chopped rosemary, salt, and pepper. Cook 1-2 minutes more, then remove from the heat and let cool slightly — hot filling will melt the pastry.
Heat the oven to 400°F / 200°C and line a sheet pan with parchment.
Unroll the puff pastry on the parchment. Lay the cheese slices over one half of the sheet, leaving a ½ in (1 cm) border along the edges.
Spread the onions evenly over the cheese.
Fold the bare half of the pastry over the filling and press the edges to seal, then roll the filled pastry up from one long edge into a log. Set it seam side down.
Cool the onions first. Warm filling softens the butter in the pastry and the roll bakes flat instead of puffy.
Shaping is flexible. The original instruction was "roll up as in the video" — folding over then rolling into a log gives layered spirals. Rolling straight from one long edge without the fold also works and is faster.
For actual twists. After folding the pastry over the filling (end of step 3), skip the log: cut the filled rectangle crosswise into ¾ in (2 cm) strips, twist each strip 2-3 turns, and bake 15-18 minutes. Individual twisters, more crisp edges, no slicing after baking.
Score the top with 3-4 shallow diagonal cuts before baking to let steam escape and keep the seam from splitting.
Cheese. Any good melter works. Skip fresh mozzarella — too much water.