I think I've spotted a bug in d3's binary search implementations that arises due to the use of unsigned bit shifts for the midpoint computation, which is a good approach when the numbers are actually unsigned integers, but not when they're floats:
https://observablehq.com/d/229d8bcf448308b9
If I've understood the problem correctly, the fix is simple, replacing
const mid = (lo + hi) >>> 1;
in bisector.left and bisector.right with
const mid = Math.floor(lo + (hi - lo) / 2)