It’s true that some aggregation functions are not supported in makeTimeseriescommand or they do not work for arrays (iterative expressions) in summarizebut you can always breakdown array into single rows and do what it needed using summarize and all aggregation functions on any fields and expressions.
First step is to build array of pairs: time and metric value. The next one is to expand it. At this moment each datapoint is individual row and you can apply any aggregation. To get it back as array using makeTimeseriesis needed, but as before this step you have each value already in its final form, you can use any aggregation function as this will be 1 filed in on record to 1 element in array conversion (I used max).
I used your query as input where you attempt to calculate distinct count of metric values for each interval.