To me that happened because the flow should have returned a table/array but probably returned object or string. Or The variable varOnCallData itself is not yet populated or is a single object, not a record containing a table - either no data or single object.
To place a first safe guard, let's check the returned output - this is bit of debugging, let's inspect varOnCallData by adding a label with JSON(varOnCallData) to see the exact structure. This will give us a clue what's coming from the flow at least.
Before checking the data, what you can do, do a safety check like this in the gallery's Item:
If(
IsBlank(varOnCallData),
[],
varOnCallData.oncalls
)
In the very first place, it will ensure there is something or nothing.
If you see data is there and it is JSON formatted (as we used JSON function or ParseJSON function), then you follow what @Kalathiya mentioned – it should work.
By very best good luck if you see data, you can parse/convert it to JSON I see one more area we can improve, which is data format, as you have mentioned. In Power Apps, the date format string is case-sensitive for the Text function. Let's use "yyyy-MM-ddTHH:mm:ssZ" instead of "YYYY-MM-DDTHH:MM:SSZ". To be very specific:
yyyy for year, MM for month, dd for day.
HH for 24-hour format hours, mm for minutes, ss for seconds.
- The uppercase
MM is month, lowercase mm is minutes
Please let me know if this helps.