Fortunately Charles XII had way, way too much on his hands to ever actually carrying out this plot, but it is something that plausibly could have ended up being a chapter in British history: The Swedish-Madagascan Pirate-Jacobite Invasion.
Fortunately?! A Swedish-Madagascan-Pirate-Jacobite invasion of Britain would have been AWESOME!