I have the same issues, when i use HKStatisticsCollectionQuery query user step count, there's a big difference in the number of steps I'm query before and after a minute's interval.
2023-12-17 15:45:41 steps=529
2023-12-17 15:46:52 steps=5817
2023-12-19 19:43:59 steps=2680
2023-12-19 19:44:31 steps=5554