Per the v2 pack index format description, for an entry, a 32-bit offset with its MSB set to 1 means the the 31-bit LSBs form an index to the higher offsets table, which contains zero or more unsigned 64-bit integers that represent the true offset of an entry when the offset is greater than 2 GiB.
format.PackIndexV2.OffsetForPos currently assumes that this is never the case and always casts a 32-bit offset to an int64, even if its MSB is set to 1.