Japan is several islands, do you have any idea how difficult it would be to smuggle in a gun?
That's why it "works", it's even more easily controlled than UK, which is one large island. Having four large land masses and six thousand smaller ones means that any smuggler who brought in a boatload of guns would not only have to bribe one port administration and one local gang, but bribe FOUR separate port administrations and four large families of gangs who are always at war. There's no way to make that economical. Even manufacturing guns wouldn't work, because again, if you made your factory in a single island you'd have to ship it by truck to other islands, which means crossing one of the few easily controlled bridges. You'd have to make four separate factories and supply chains.
Japan has the geography of a perfect police state, think of the four mainland islands as large cell blocks. If there's trouble in any one, the police can easily shift materiel to deal with it without losing control over the other three. In fact if I were a space explorer who happened upon our planet, and my task was to "build a prison on X planet" my choice would be a chain of islands.
Also It doesn't work. Common criminals terrorize civilians with knives and axes, organized crime has more guns than the government and is treated as a de-facto sovereign body within Japan. Just recently a silenced submachine gun battle took place in Tokyo.
https://www.tokyoreporter.com/crime/shots-fired-at-yakuza-office-in-kabukicho/