Replicators don’t create matter from energy, they rearrange matter to make things.🤔
It was explained several times in TNG that replicators work similar to the transporters. They covert matter to energy and back again. They of course don’t explain exactly how this works, but it takes a lot of energy to make even a tiny amount of matter.
Let’s take a sugar cube weighing 3 grams, for example. Using E=MC^2, the food replicators would need 2.7x10^14 joules of energy to create this. It equates to a 64 kiloton nuclear weapon, or about 4 Hiroshima bombs.