Two possible reasons:
I had this problem and found that our Teltonika device was sending data in the wrong order i.e if it recorded a point offline and then uploaded it, if it send the newest first, then the oldest, Traccar calculated it incorrectly. Just reconfigure your device to send the data in oldest to newest order.
Hello Anton,
I did a trip today and Traccar show me -6 km I don't understand why. I've searched in the forum but I didn't find the solution.