If you actually read the source in Lancet, you would know that this is an estimate without any evidence.
The estimate is originally from months ago and hasn’t accumulated any evidence since.
The Hamas run health ministry not only counts bodies, but also other people they have some proof that they died. For example if people are known to be buried in rubble, they are already counted. Granted not all bodies under the rubble are counted.
However the predicted high numbers of dead caused by famine and disease have not materialized during the last half year.
I don’t doubt that the situation is bad. The destruction of infrastructure makes everything more difficult, including health care. Doctors also only see the worst aspects in situations like this.
What makes Gaza a special case, is that refugees aren’t allowed to flee to a safe neighboring country or at least the West Bank. The refugees should be allowed to leave the war zone, like they are in every other war. They would be better off in a place with working infrastructure.
Hamas’ insistence on continuing the war is the reason it came to this. If they cared for their people, they would have surrendered months ago and freed the hostages. If Hamas didn’t use hospitals for military purposes, they wouldn’t be attacked.