You need to specify a sample_size. The default sample_size is twenty. Once twenty samples are recorded it starts to reuse the sample storage places so even if you specify 24 hours as max_age that sample was likely overwritten. So if a sample is taken every 15 minutes then for 24 hours you need 24*4=96 sample slots.
As you can see this can get kind of wasteful of memory especially if you only want to save the maximum value. A better solution would be to write a little automation that checks the max (input_number) versus the current temp and keeps the higher value on every temperature change plus just keeps the current value as maximum at midnight.