I hope it's good. It's just an idea.
One POD could be the Great Anti-Buddhist Persecution initiated by Tang Emperor Wuzong. Among its purposes were to appropriate war funds and to cleanse China of foreign influences. As such, the persecution was directed not only towards Buddhism but also towards other religions, such as Zoroastrianism, Nestorian Christianity, and Manichaeism.
Islam was brought to China during the Tang dynasty by Arab traders, who were primarily concerned with trading and commerce. It is thought that this low profile was the reason that the 845 anti-Buddhist edict ignored Islam. This edict could have included Islam. The persecution lasted for twenty months—not long, but long enough to have permanent effects.
This persecution pushed Islam to Japan. Exiled muslim traders from China chose to create a small muslim community in Kyushu Island and Heinan-Kyo. It is the period in Japanese history when Buddhism, Taoism, Islam and other Chinese influences were at their height. The Heian period is also considered the peak of the Japanese imperial court and noted for its art, especially poetry and literature.
Islam began to spread throughout Japan during the Heian period, alongside Buddhism, leading a curious situaiton. Buddhism aimed to connect state and religion and establish support from the aristocracy.
Marriage between upper class Japanese and muslims stays low at first, since upper class Japanese men would both refuse to marry Muslim women, and forbid their daughters from marrying Muslim men, since they did not want to convert due to their upper class status.
Only low and mean status Japanese men would convert if they wanted to marry a muslim woman. Conversion rates would be still high among members of the Hinin class, peasants and jizamurais, thanks to the Islamic message of equality.
Nevertheless the presence of this growing muslim community improved both trade and relations between Japan and China during the Song dynasty and later. The office of Director General of Shipping was consistently held by a Muslim during Song dynasty, according to Ting, Dawood C. M. (1958), "Chapter 9: Islamic Culture in China", in Morgan, Kenneth W., Islam—The Straight Path: Islam Interpreted by Muslims, New York: The Ronald Press Company, pp. 344–374.
Protecting Muslim traders and converts was gradually seen as a great way for daimyos to gain the upper hand in trading with China. As a result, several daimyō became muslims, soon to be followed by many of their vassals.
With the introduction of Buddhism and Islam and their rapid adoption by the court and commoners, it became necessary for philosophers and religious leaders to explain the apparent differences between native Japanese beliefs and foreign teachings. This intellectual effort resulted in a new religious identity specific to Japan.
The new social order of a declining Buddhist aristocracy and ascending military and peasant muslim classes resulted in new forms of religions, including islamo-buddhism and shinto-islam.
The times that gave way to the Kamakura period were marked by political and military conflict, natural disasters, and social malaise attributed to the perceived arrival of the Latter Day of the Law. Islamic eschatology quickly became popular during this period and its teachings mixed with local fringe groups.
The best example of such a syncretism are the Ikko-Ikki with their slogans "Hail to Buddha Amida“ and ”Hail to Buddha Mahdi“ in the 15th-16th centuries.
The Japanese official contacts with the Ming dynasty began during the Muromachi period after the Chinese sought support in suppressing Japanese pirates in coastal areas of China. Wanting to improve relations with China and to rid Japan of the wokou threat, Yoshimitsu accepted a relationship with the Chinese that was to last for centuries.
In 1401 he restarted the tribute system, describing himself in a letter to the Chinese Emperor as "Your subject, the King of Japan". The Xuande Emperor hired Zheng He, to lead an expedition to Japan in 1430. This expedition similar to his previous expeditionary voyages to Southeast Asia, South Asia, Western Asia, and East Africa was set to improve the relations between Ming dynasty and Ashikaga shogunate.
As a result, an official Chinese embassy is opened in Japan and a triangular trade is officially established between daimyos, China and Southeast Asia, controlled by the Tanegashima clan and the Hosokawa. It led to the creation of official Japanese trading colonies in various areas, including military forts built to defend traders.
The presence of Japanese traders and soldiers in southeastern Asia was already witnessed by Marco Polo in the 12th century. A common faith greatly helped Japanese traders and settlers in Southeast Asia. Japanese ronins often acted as bodyguards for local sovereigns and rulers.
In 1420, the creation of the Japanese trading colony and heavy forts of Singapura was accepted by Megat Iskandar Shah in exchange of the creation of his own ”Ronin guard“ made of 10’000 samurais. For centuries, European attempts to rule in Southeastern Asia will be severely hampered by the presence of Japanese settlers and soldiers causing numerous administrative and endless military difficulties.
In 1467, the Ashikaga shoguns were reduced to such powerlessness that control of the lucrative China trade became contested between the nominal Ashikaga vassals the Hosokawa clan in Kyoto and the Ōuchi clan of Yamaguchi. Trade continued despite this rivality.
In 1511, minor Japanese trading colonies situated near Malacca straits were attacked by Portuguese explorers. Survivors of this attack describe their attackers as faithless and unthrustworthy barbarians.
—————-
Impact of the Malaccan on China and the rest of the world :
The Portuguese attacks of Malacca enraged the Zhengde of China when he received the envoys from the Sultan Mahmud accompanied by Japanese envoys. The furious Chinese emperor responded with brutal force, culminating the period of the decades of prosecution of Portuguese in China.
Among the earliest victims were the Portuguese envoys led by Tomé Pires in 1516 that were greeted with great hostility and suspicion. The Chinese confiscated all of the Portuguese property and goods in the Pires embassy's possession. Two successive Portuguese fleets bound for China in 1521 and 1522 were attacked and defeated in the first and second Battle of Tamao.
After the Portuguese bribed their way into obtaining a trade mission in Ningbo and Quanzhou, they inflicted savage behaviour against the Chinese, and raided the Chinese ports. In retaliation, in 1545 the entire Portuguese community of Ningbo were exterminated by Chinese forces. It’s only by 1620 that Ming China finally agreed to allow Christian traders to settle on Tamao Island in a new trade colony, similarly to the Dutch factory in Deijima.
The so-called informal 400 years Mandarin alliance between China and Japan was built during this period of Christian peril. Those two countries were later joined by Joseon dynasty in 1666 after the escape of Hendrick Hamel. Together they would prove successful enough to deter most of European threats.
Repeated attempts by Portuguese, Spanish and Dutch settlers on Taiwan Island were repulsed by Chinese and Japanese joint forces in the 17th and 18th century. The same events happened in Korea, where expansionist attempts were blocked by diplomacy. Unfortunately war was necessary in Viêt Nam to defend this country from French invaders in 1843. This war consolidated China and Siam relations.
This informal alliance lasted until the 19th century, when it was joined by Siam and Russia in 1850, after the first Opium War fought by Great Britain against China, Japan and Korea with informal Russian support.
This alliance was of great use against the Taiping rebellion (1851-1864), a war in which Ottoman Empire and Prussia decided to send advisors.
....
——————
In May 1523, trade fleets from both the Hosokawa and the Ōuchi clans arrived in Ningbo. Despite a violent incident between the Japanese delegations, the Hosokawa delegation, led by a Chinese muslim convert named Song Suqing, was able to secure its direct trade rights with China and to keep Ningbo port open to Japanese trade. This agreement led to a quick downfall of the Ouchi clan.
During the 16th century, traders and Jesuit missionaries from Portugal reached Japan for the first time, initiating direct commercial and cultural exchange between Japan and the West. Unfortunately for them, southwestern daimyos weren't interested in new commercial brokers, since their trade system with Southeastern Asia and China was already well consolidated.
When Xavier disembarked in Kagoshima, the principal chiefs of the two branches of the Shimazu family, Sanehisa and Katsuhisa, were warring for the sovereignty of their lands. Katsuhisa, adopted Takahisa Shimazu who in 1542 was accepted as head of the clan having previously well received the Portuguese merchants on Tanegashima Island, learning about the use of firearms.
In 1549, he met St. Francis Xavier at the castle of Uchiujijo. Xavier asked for the conversion of his vassals. Having a shinto-muslim religious background, Takahisa showed himself to be benevolent and already allowed freedom of worship but refused helping the missionaries nor favoring their church.
Unable to find a way to the centre of affairs, the court of the Emperor, the uncompromising Xavier took to the streets denouncing, among other things, infanticide, idolatry, homosexuality and even worse Islam. Misunderstandings were inevitable and he was later decapitated by Takhisa himself.
In 1559, Gaspar Vilela was denied permission from Ashikaga Yoshiteru to teach Christianity. Emperor Ōgimachi issued edicts to ban Catholicism in 1565 and 1568. Toyotomi Hideyoshi also promulgated a ban on Catholicism in form of the "Bateren-tsuiho-rei" (the Purge Directive Order to the Jesuits) on July 24, 1587.
Hideyoshi put Nagasaki under his direct rule to control Portuguese and Spanish smugglers while allowing Dutch sailors to trade with Japan. It didn't last long. Following incidents between Dutch sailors and muslim imams, Christianity was officially banned in 1614 and all Christian missionaries/priests ordered to leave.
Sakoku was the isolationist foreign policy of the Japanese Tokugawa shogunate (aka Bakufu) through a number of edicts and policies from 1633–39. Japan was not completely isolated under the sakoku policy.
It was a system in which strict regulations were applied to commerce and foreign relations by the shogunate and by certain feudal domains (han). There was extensive trade with China, Korea, Russia, Southeastern Asia and the Ottoman Empire.
The policy stated that the only Christian influence permitted was the Dutch factory at Dejima in Nagasaki. It thus didn't stop trade between the Netherlands and Japan, but drastically reduced Christian conversions due to a lack of missionaries and priests. Many Christian converts, without contacts with priests, turned themselves to Islam and its local versions.
Christianity only came back to Japan in 1853, when the American Black Ships commanded by Matthew Perry forced the opening of Japan to American trade through a series of unequal treaties.
Christianity is still a minor religion in the archipelago. Around 0.5 percent of the population claims Christian belief or affiliation, while the various Islamic cults are observed by roughly 50% of the Japanese.