In https://github.com/elastic/elasticsearch/pull/88639 we introduced a new setting that allows configuring a maximum headroom in disk watermarks that helps reducing the waste of disk space in large disks. The disk health indicator should take that new setting into account to avoid reporting issues when there's still room for new data in the cluster. 

https://github.com/elastic/elasticsearch/blob/6ec31ed1533e6aaf8fc6dabda5e419f5dce984fa/server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java#L193-L199

Those calls should take into account the available max headroom.
server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java
highMaxHeadroom.writeTo(out);
                floodStageMaxHeadroom.writeTo(out);
            }
        }
        @Override
        public boolean isFragment() {
            return true;
        }
        @Override
        public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
            builder.field(HIGH_WATERMARK_FIELD.getPreferredName(), describeHighWatermark());
            builder.field(HIGH_MAX_HEADROOM_FIELD.getPreferredName(), highMaxHeadroom);
            builder.field(FLOOD_STAGE_WATERMARK_FIELD.getPreferredName(), describeFloodStageWatermark());
            builder.field(FLOOD_STAGE_MAX_HEADROOM_FIELD.getPreferredName(), floodStageMaxHeadroom);
            builder.field(FROZEN_FLOOD_STAGE_WATERMARK_FIELD.getPreferredName(), describeFrozenFloodStageWatermark());
            builder.field(FROZEN_FLOOD_STAGE_MAX_HEADROOM_FIELD.getPreferredName(), frozenFloodStageMaxHeadroom);
            return builder;
        }
        private ByteSizeValue getFreeBytes(ByteSizeValue total, RelativeByteSizeValue watermark, ByteSizeValue maxHeadroom) {
            if (watermark.isAbsolute()) {
                return watermark.getAbsolute();
            }
            return ByteSizeValue.subtract(total, watermark.calculateValue(total, maxHeadroom));
        }
        public ByteSizeValue getFreeBytesHighWatermark(ByteSizeValue total) {
            return getFreeBytes(total, highWatermark, ByteSizeValue.MINUS_ONE);
        }
        public ByteSizeValue getFreeBytesFloodStageWatermark(ByteSizeValue total) {
            return getFreeBytes(total, floodStageWatermark, ByteSizeValue.MINUS_ONE);
        }