Let me see if I've got this right:
There were many names for the islands. But the Chinese called them Nippon/Nihon ("sun origin") because it's east of them.
Italian merchants wrote down the Indonesian pronunciation of the Chinese name as Gaipan, which became Japan in English.
When a 1943 Batman movie villain said "Actually, I prefer to be called Nipponese," there was a pause for the audience to boo. Because we'd been asked to correct it and didn't want to.
So we still call Nippon "Japan."