@DTS Engineer We're seeing the same issue on iOS 27.0.1 with HKStatisticsCollectionQuery (stepCount, .cumulativeSum, 1-hour interval). For past date ranges it sometimes returns nil sumQuantity() for hours that do have samples. There's no error, and running the same query a few seconds later returns the correct values.
We've filed FB25242891 with a sysdiagnose (HealthKit logging profile installed) that captures it happening. Posting the number here in case it helps Apple link related reports.
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags: