Melt the butter in a large saucepan or use the sauté function on an electric pressure cooker. Add the onions and cook slowly for about 30 minutes, stirring occasionally, until deeply caramelised and dark golden brown. Meanwhile, season the pork shoulder generously with salt and pepper. Heat the olive oil in a large frying pan over high heat, then sear the pork on all sides until well browned. Set aside. Remove the onions from the pan and add the mushrooms, thyme, rosemary and carrots. Cook for 10 minutes, or until the mushrooms are golden brown and the carrots have begun to soften. Stir in the garlic and cook for another 1-2 minutes. Pour in the red wine and beef stock, and bring to a simmer.
Transfer the caramelised onions, pork and stock mixture into the pot. Seal and cook on high pressure for 1 hour and 15 minutes.
Preheat oven to 180°C. Place the onions, pork and stock mixture into a Dutch oven with a lid. Cover and cook for 3 hours, or until the pork is fork-tender.
Once cooked, remove the pork from the pot, shred the meat and set aside, covered. Bring the broth to a simmer using the sauté function on the pressure cooker or over medium heat on the stovetop. Mix the corn flour with a small amount of water to form a slurry, then stir it into the soup to thicken it. Return the pork to the soup and stir through. Taste and adjust the seasoning with salt and pepper as needed.
Ladle the soup into ovenproof bowls. Top with a slice or two of baguette and scatter over the Gruyère and mozzarella. Place under the grill until the cheese is melted and bubbling. Garnish with a sprinkle of fresh thyme and serve immediately.