There were several reasons why this could not or would not happen.
1. Shoguns were appointed officers of the state
Although one might describe the Shogunate as hereditary (in the same sense that the Crown of the Holy Roman Empire was "hereditary"), the office of Shogun was technically an Imperial appointment. Powerful samurai clans lobby the Imperial Court for appointment to this office, in order to legitimise their military governments with the backing of Japan's ancient civic laws. The heredity of their feudal power gave the impression of hereditary succession to their chosen titles[Note 1], but this is not strictly accurate.
This is more than just a matter of technicalities. The fact that the Shogun is not a feudal title, but rather an office of state, meant that a person would not "inherit" both positions. A reigning Emperor will not be appointing himself the new Shogun. It would be like HM Queen Elizabeth II asking herself to form a new government for the United Kingdom as her own Prime Minister. If ruling Shogun were to somehow ascend to the Chrysanthemum Throne, he wouldn't appoint himself his own Shogun.
In reality, when the Minamoto line of Shoguns went extinct, the Imperial Court appointed aristocrats and royals to head the Shogunate.
2. Neither Emperor nor Shogun would've run out of regular heirs
For one thing, they both typically had concubines for mass producing direct heirs.
More importantly, there was (and is) a long lasting, culturally acceptable tradition in Japan for adopting capable adults from other families as heirs - even after death. If a Shogun had no direct heirs, he most likely would have adopted someone. And if he died suddenly without making proper arrangements, his clan would find
a nice puppet someone suitable for posthumous adoption. For example, when the Yonezawa lord Uesugi Tsunakatsu died without heir, his father-in-law arranged to have his dead body adopt his sister's son, two year old Kira Sannosuke, as the future Uesugi Tsunanori.
In any event, both the Imperial Family and most leading clans (including the Shoguns) typically have several branches, some explicitly for the purpose of providing backup heirs when the main line fails. For example, the Tokugawa Clan's senior (Shogunate) line went extinct on four occasions: The fourth, seventh, thirteenth and fourteenth shoguns all had no issue. In each case, the Shogunate Line was preserved via adoption from a cadet branch.
Similarly, the Imperial Family established several
miyake, lit. Palatial Families', which were considered royal no matter how distant their relations to the reigning emperor gets. Their members were always eligible to inherit the throne, and did so on several occasions including the Go-Hanazono Emperor, who succeeded a third cousin. In effect, there was no single Imperial Family, but rather one crown bouncing between several Royal Families.
3. There would be absolutely no point to it.
Let's assume that the Shogun and Emperor really wanted to merge[Note 2], and did something crazy like adopt the Crown Price as his official heir.
As touched upon earlier, the office of Shogun did not confer power, but rather legitimised it. Thus, the real source of power was the hereditary feudal holdings of the samurai clans. The reason they became rulers of Japan was due to the political weakness and nonexistent military strength of the Imperial Court. If the Court remained weak, there was no conceivable way for it to maintain control over the Shogun's holdings. Thus, some other de facto governor must be appointed. He might not be called the Shogun, but there would have been no practical difference.
Alternatively, if the Court recovered its strength (which it started to do near the Meiji Restoration), then it could simply not appoint a Shogun - which, again, remained an imperial appointment right to the end. For example, the last Tokugawa Shogun, Yoshinobu, despite possessing (in theory) military superiority, broke upon being placed under Imperial Ban. He then fled from an impending battle with Imperial(-aligned) troops without a fight, and surrendered his lands, powers and titles to the Imperial Court.
4. Keeping the family name alive was a very important consideration
There isn't much to elaborate here. Japanese culture valued the continuation and perpetuation of the clan name. For example, a clan might expand its power by "inheriting" another domain (more of a Warring States era thing). This typically involves a junior son changing his name to the inherited clan's, rather than merge everything into the main title. The inherited clan thereafter became "part of the family", so to speak, despite the different surnames.
For example, the Mōri clan had the Two Mōri Kawas: the Kikkawa family and the Kobayakawa family. Both were renowned warrior families who were absorbed into the Mōri clan via being "inherited" by two junior sons of Mōri Motonari.
There was no particular reason for the military governors of Japan to be styled Shogun. A sufficiently powerful and determined samurai lord can impress the Imperial Court into appointing himself Shogun (most popular), or
Kampaku 関白 (chancellor-ish) (which Toyotomi Hideyoshi chose), or
Sesshō 摂政 (regent) (like the Fujiwaras), or
Daijō-daijin 太政大臣 (Prime Minister) (as Taira no Kiyomori achieved), or really anything they could think of or make up.
In reality, the preferred historic method is to marry into the royal family while maintaining your own lineage of temporal power. The best example is the Fujiwara clan, who for centuries monopolised the powerful positions of Sesshō and Kampaku. They entrenched their position by marrying into the Imperial Family as Empress Consorts and Crown Princesses.
This was imitated by the early samurai regimes too. Taira no Kiyomori married his daughter Tokuko to the Takakura Emperor. Even Minamoto no Yoritomo, who overthrew the Taira regime and established the Kamakura Shogunate, attempted to have his daughters married into the Imperial Family - he was only thwarted because both daughters died young.
Later Samurai lords attempted similar tactics on occasion, though not to the same degree; for example, Shogun Tokugawa Ieyasu married his granddaughter Masako to Emperor Go-Mizunoō.