I experienced the same problem and just solved it going out from the challenge and back in the challenge (a friend of mine invited me again)
I have not lost any km since if you get in the challenge in the middle of it even the km you've done before will count