Ok, after a bit of research, it seems that sometimes Pokemon Go will give you a candy, then show a negative distance that you have to walk off to get the candy you just got for free.
If this happens to you, be very happy because changing your Pokemon gets rid of the negative distance and you get to keep the candy 😋