UN reports have consistently referred to Gaza is occupied; your point about the ambiguity of the ICJ's 2004 ruling is noted, but it looks like UN's policy was to provisionally consider that a claim that Gaza is still occupied, while in 2022 or early 2023, requesting the ICJ put out a clarifying advisory opinion.