I'm having an issue with the latest version of PKHeX, (v200314 as of writing)
Holding Shift while sorting to mass sort all boxes seems to unintentionally change a number of Trainer Data values, drastically increasing the values: egg_hatching, capture_wild, total_capture, trade, and wild_pokemon_encountered.
I believe PKHeX is somehow treating sorting the boxes as brand new encounters (pokemon caught/encountered values) and also trades simultaneously, as I have performed no trades on this savefile, yet the "trades" value reached into the thousands after sorting a few times.
Update, 18/03/2020:
It appears that virtually any use of the Batch Editor to modify Pokemon also triggers this issue.