The $K^−$ over $K^+$ multiplicity ratio is measured in deep-inelastic scattering, for the first time for kaons carrying a large fraction z of the virtual-photon energy. The data were obtained by the COMPASS collaboration using a 160 GeV muon beam and an isoscalar $^6$LiD target. The regime of deep-inelastic scattering is ensured by requiring $Q^2>1$ (GeV/$c)^2$ for the photon virtuality and $W>5$ GeV/$c^2$ for the invariant mass of the produced hadronic system. Kaons are identified in the momentum range from 12 GeV/$c$ to 40 GeV/$c$, thereby restricting the range in Bjorken-$x$ to $0.01 < x < 0.40$. The $z$-dependence of the multiplicity ratio is studied for $z>0.75$. For very large values of $z$, i.e. $z>0.8$, the results contradict expectations obtained using the formalism of (next-to-)leading order perturbative quantum chromodynamics. This may imply that cross-section factorisation or/and universality of (kaon) fragmentation functions do not hold. Our studies suggest that within this formalism an additional correction may be required, which takes into account the phase space available for hadronisation.