Microsoft did not leave Japan, they are in fact expanding Xbox Asia and have added an Asian team to the Global Gaming Partnership and Development (GDDP) division: https://www.google.com/search?q=xbox+asia+expanding
So sometimes, (like in this case, it looks like), it may just really be the case of a business not being able to adopt to the different expectations of Chinese consumers.
I was just reading the other day about why U.S. car makers struggle in Japan and that for example domestic car makers there offer the ability to customize the car to an extent U.S. companies can't compete with.
It's likely that Amazon faced enough competition naturally, given its low market share.
Culture is varied and in many ways everything. Competition is also biased and fierce. At least that's my understanding of things (as a white guy born and remaining in the SW USA).
I do find it funny that Amazon is pivoting to "high quality cross-border sales" considering that into the U.S. seems to be low quality, high markup sales (including high levels of counterfeits) with no end in sight.
Not that different than Microsoft sunset their gaming business in Japan