Not 100% sure if this is the one, but fixing this bug in 1.19.4 may have caused some havoc in totalKillCount scoreboards (and similar objectives). I've been using this objective to display custom kill messages, and sometimes they showed the wrong player credited for the kill, most likely the one to deal the most damage. It was all working in 1.19.2 and before.
From what I see, the parent ticket is certainly related, as it mentions the primary villager buy slot, but doesn't show the same issue. The primary slot works perfectly, but the secondary doesn't.