The relationship which "manages to be exogamous and endogamous at the same time" is that of the cousin-cousin relationship.
Cousin-marriage is ideal for any group that wishes to keep its resources "all in the family." The Old Testament is rife with marriages that are not technically within the immediate family-- and so are somewhat exogamous-- but which are within a more general clan, and are hence endogamous in their effect.
Though some cultures split hairs about how far the cousins could be "removed" before intermarriage was possible, some literary works make it clear that first-cousin marriage endured into comparatively recent times, especially for the aristocracy, who certainly had the best motives for centralizing their resources. On my film-blog I reviewed two movie-versions of Wilkie Collins' detective novel THE MOONSTONE here, and in this essay I included a brief summation of the novel, calling attention to the fact that nowhere in the novel does anyone think it odd that wealthy heiress Rachel is romanced by not one but two of her first cousins. I noted also that the first American-made film to adapt the novel dispensed with this trope, that the female lead's "good" suitor was completely unrelated to her while the "bad" suitor remained a near relation. This doesn't mean that one can't find any positive examples of "first cousin marriage" in early American films. But the change certainly suggests that one or more of the persons producing the 1934 MOONSTONE film felt that the audience might not accept such a situation, even though the action of the movie is still set in England.
Yet in some American cultures the practice of cousin-marriage did continue, possibly in subconscious imitation of English customs. When I read Margaret Mitchell's GONE WITH THE WIND for the first time, I was taken aback by how chock-full of "sibling clansgression" it is.
The 1939 movie maintains the plot-thread in which Scarlett steals a beau from her sister Sue Ellen, but it omits the fact that early in the novel Scarlett also swipes the attention of the man adored by her other sister Careen-- and does so not because she Scarlett wants to bed or marry the fellow, but just to assert her superior skills at "vamping" males.
I don't recall whether or not the movie mentions the fact that Ashley and his bride Melanie are distant cousins, but the novel is far clearer on the point that their family's members prefer to "stick to their own kind." They are, Mitchell suggests, a pure strain of Old South aristocracy that will prove unable to cope with the demands of the New South, unlike Scarlett, who inherits her commoner Irish father's skills at wheeling and dealing. Scarlett marries Melanie's brother Wade, who dies early in the war, and so Scarlett becomes sister-in-law to Melanie, thus transgressing on the rules of propriety both when she desires and when she pursues Ashley.
Finally, there's no relation between Scarlett and her eventual husband Rhett Butler, though he is of course from a genteel Southern family and is of good stock, in contrast to the "cracker" Will Benteen, who ends up marrying Sue Ellen. However, cousin-cousin romance stands behind the relationship of Scarlett and Rhett in a symbolic sense. While the movie tells the audience nothing about the backstory of Scarlett's mother Ellen, the reader learns from Mitchell that Ellen once had a passionate love-affair with one of her cousins, name of Phillippe. But because Ellen's family sent him away from the home, Phillippe-- implicitly a hell-raiser like Rhett Butler-- died in a bar-brawl, and thus Ellen married Scarlett's father Gerald on the rebound. It seems fairly obvious that Mitchell meant to suggest that the Ellen-Phillippe relationship prefigured that of Scarlett and Rhett on a non-diegetic level, even though no character but Ellen ever knows about the forbidden-- and thus implicitly racy-- relationship.
I regard cousin-cousin liaisons as symbolically parallel to those of siblings because in most though not all cases, there is no significant difference in age between the subjects. When a difference in age does appear in such a relationship, that difference tends to overpower the quasi-sibling symbolism.
Next up: when transgression is "cooperative" with, or "competitive" with, a given culture's mores.