If ALL the issue of Geo III, male and female, were extinct (including the issue of the marriage of the D of Susses to Lady Augusta Murray, illegal by British law, but probably legal by German law); then the next heir to Hanover (as Duke of Brunswick Luneburg, by descent from Ernst I (1497–1546), which is when the lines split, would be Charles II, Duke of Brunswick, who was deposed by his people in favour of his brother William, and was probably insane.
However, the /legal/ heir to the throne of Britain would be the Princess Sophia of Gloucester, eldest daughter of Geo III's brother William Henry, Duke of Gloucester. This was an "improper" marriage, but as it took place in 1766, before the Royal Marriages Act 1772, it was legal under British law (but possibly not under German law, but since there were no male issue that question does not need to be traversed).
The D of Gloucester's older sister Augusta married into the "other" Brunswick line , )married Charles II's grandfather), but the line of succession in Britain takes males first, so goes through the D. of Gloucester's line first.
If Princess Sophia were excluded, then the next heir to the British throne would be Charles II of Brunswick, but through his grandmother , Princess Augusta, not through his father.
Incidentally, neither Charles nor William of Brunswick left children OTL . If that occurred OTL, then the next British heir (assuming Princess Sophia had been excluded) would be the Duke of Wurtemburg, descended from Augusta's daughter. For a Brunswick heir we have to go back to the beyond Henry the Lion of Saxony in the 12th century .ie effectively, no male heir, so the girls get a look in, which /probably/ means the same Duke of Wurtemburg. (EDIT: OTL, or course, Williams heir was Ernst Augustus of Hanover (deposed), the grandson of "our" Ernst, Duke of Cumberland. But TTL, Ernst, Duke of Cumberland is removed, by the term of the PoD)
I think. But this is insanely complicated stuff.