Ok, lots to unpack here. These are my observations:
Your query should return all available data within the time frame *
You can manually view the actual data available in the Apple Health app under the Browse Tab -> Heart -> Heart Rate -> Show All Data (At the Bottom)
I'm assuming that you're likely referring to Heart Rate data recorded by Apple Watch. In normal operating mode, Apple Watch will only generate a Heart Rate measurement every 4 - 5 minutes when the user is wearing their watch. If they start a workout, this increases to about 12 measurements per minute. This is where the HKQuantitySeriesSample comes in useful for efficiently querying this high intensity data
This code would allow you to access the first HR value from the sample you have run
if let result = results.first as? HKQuantitySample {
print(result.quantity.doubleValue(for: HKUnit(from: "count/min")))
}
To answer your last original question, you can't read Health data that is not there. For Heart Rate, I think from what you're saying, you either need to generate and save data to the Health Store, or wait for the user to record it (presumably via Apple Watch) before trying to read it
*Right, going back to my original point and trying to answer your additional question. If you are querying the Health Store on iPhone, the Health Store data is only limited to what's actually saved in it, I'm not directly sure why you're only getting 10 days of data. That said, if its regular Heart Rate data the this is quite a big query, I'd recommend breaking it down into multiple queries and changing the predicate dates you have set. If you're querying on Apple Watch, you're only guaranteed to have access to the last 7 days of Health data.