I am confused about the cosmological constant and dark energy. In the most accepted theory, energy is created as the vacuum of space expands. This contravenes the conservation of energy. The law of conservation of energy does not hold in curved spacetime but isn't our universe flat spacetime ? What am I missing here ?