With the gyro period at or below BMI_VERNIER_MAX_PERIOD_US (2500 µs), the count comes from fifo_status_2 (bmi088_core.c) but the overrun flag comes from fifo_status_1 & 0x80. bmi_flush_fifo() writes the FIFO config registers, which is what clears the sticky bit. In bmi_spsc.c the overrun check runs before the seeding flush). An overrun first seen in the second read can be flushed away without being counted.