This question already has an answer here:
We only can speak about the energy density in a container if its energy content is independent from its dimension -so could, in principle, have any value at all. If in Einstein’s statement “People before me believed that if all the matter in the universe were removed, only space and time would exist. My theory proves that space and time would disappear along with matter” we may replace ‘matter’ with ‘energy,’ then the energy content of the universe is not independent from its volume. Doesn’t this mean that we cannot then speak about the energy density of the universe as a whole?