Wash the rosemary, shake dry, and roughly chop. Peel the red onion and cut into thin wedges. Peel the garlic and mince. Combine the halloumi, chopped rosemary, garlic, olive oil, and onion wedges in a bowl, cover, and refrigerate for 2 hours or preferably overnight.
Pat the roasted pepper pieces dry. Clean, wash, and shake dry the rocket. Halve the hamburger buns and brush the cut surfaces with herb butter.
Heat a coated pan over medium-high heat. Remove the halloumi from the marinade and fry on both sides for 2-3 minutes until golden brown. Add the remaining marinade with onions and herbs to the pan and fry for 1 minute. Transfer the halloumi and onion mixture to a plate.
Place the bottom halves of the buns on a serving plate. Top each with a piece of halloumi, then add the roasted pepper pieces, fried onions and herbs, and rocket leaves. Cover with the top bun halves.