> I'm seeing an unexpected behavior at the edge cases (-18, -17 and 17 and 18 offsets)

I don't think these are edge cases.