Cosmological implications of the KOTO excess