What you're talking about is "modified sixth freedom rights", which are a form of cabotage:
Cabotage is the transport of goods or passengers between two places in the same country by a transport operator from another country. ... In aviation, it is the right to operate within the domestic borders of another country. Most countries do not permit aviation cabotage, and there are strict sanctions against it, for reasons of economic protectionism, national security, or public safety. ...
The "modified sixth freedom" refers to the right to carry passengers between two points in country A through a hub in country B; for instance, a Boston-Toronto-Seattle itinerary. Such services are currently considered to constitute cabotage and are not permitted.
Since most countries prohibit cabotage, this probably means that such itineraries would not be openly advertised or bookable as a single ticket. For example, in 2002 Asiana was fined for offering flights from Guam & Saipan to the continental US via Seoul. In other words, such itineraries would be less likely to "show up on Skyscanner or similar"; you'd have to explicitly construct a nested itinerary (one round-trip ticket from A to C and a separate ticket from C to B), with all the hassle and risk such itineraries entail.
The main exception to all of this is the EU, where all member states have granted cabotage rights to all others. Most EU member states have well-developed domestic air networks (not to mention rail networks), so I suspect that traveling from (say) Marseille to Bordeaux via Frankfurt would not be cost-competitive with a flight purely within a country. But you never know; if such an itinerary exists, that'd be where I'd look for it.
EDIT: As correctly pointed out in the comments, cabotage laws don't prevent a carrier flagged in Country A to offer an itinerary connecting two cities in Country A via a city in Country B; they merely prevent carriers flagged in Country B from doing so. However, it has also been pointed out in the comments that such itineraries would involve a higher degree of hassle regarding immigration, which would reduce the incentive of a carrier to offer such itineraries. Also, given the hub-and-spoke model that most airlines employ, it would be a rare case in which this was the only option; and if other itineraries existed within Country A, I suspect they would be cheaper.